v8 5.1 => 5.2
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3279 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
ef1fa591e5
commit
14682d8be7
@ -51,7 +51,7 @@ else:
|
|||||||
env.Append(LINKFLAGS=['-g'])
|
env.Append(LINKFLAGS=['-g'])
|
||||||
env.Append(LIBPATH=[
|
env.Append(LIBPATH=[
|
||||||
os.path.join(v8, 'out/native/obj.target/third_party/icu'),
|
os.path.join(v8, 'out/native/obj.target/third_party/icu'),
|
||||||
os.path.join(v8, 'out/native/obj.target/tools/gyp'),
|
os.path.join(v8, 'out/native/obj.target/src'),
|
||||||
os.path.join(uv, 'out/Debug/obj.target'),
|
os.path.join(uv, 'out/Debug/obj.target'),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ void Database::getAll(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::onRelease(const v8::WeakCallbackData<v8::Object, Database>& data) {
|
void Database::onRelease(const v8::WeakCallbackInfo<Database>& data) {
|
||||||
data.GetParameter()->_object.Reset();
|
data.GetParameter()->_object.Reset();
|
||||||
delete data.GetParameter();
|
delete data.GetParameter();
|
||||||
}
|
}
|
||||||
@ -181,7 +181,7 @@ void Database::ref() {
|
|||||||
void Database::release() {
|
void Database::release() {
|
||||||
assert(_refCount >= 1);
|
assert(_refCount >= 1);
|
||||||
if (--_refCount == 0) {
|
if (--_refCount == 0) {
|
||||||
_object.SetWeak(this, onRelease);
|
_object.SetWeak(this, onRelease, v8::WeakCallbackType::kParameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ private:
|
|||||||
static int _count;
|
static int _count;
|
||||||
|
|
||||||
static Database* get(v8::Handle<v8::Value> databaseObject);
|
static Database* get(v8::Handle<v8::Value> databaseObject);
|
||||||
static void onRelease(const v8::WeakCallbackData<v8::Object, Database>& data);
|
static void onRelease(const v8::WeakCallbackInfo<Database>& data);
|
||||||
|
|
||||||
static void get(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void get(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
static void set(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void set(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
|
@ -643,11 +643,11 @@ void Socket::ref() {
|
|||||||
void Socket::release() {
|
void Socket::release() {
|
||||||
assert(_refCount >= 1);
|
assert(_refCount >= 1);
|
||||||
if (--_refCount == 0) {
|
if (--_refCount == 0) {
|
||||||
_object.SetWeak(this, onRelease);
|
_object.SetWeak(this, onRelease, v8::WeakCallbackType::kParameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Socket::onRelease(const v8::WeakCallbackData<v8::Object, Socket>& data) {
|
void Socket::onRelease(const v8::WeakCallbackInfo<Socket>& data) {
|
||||||
data.GetParameter()->_object.Reset();
|
data.GetParameter()->_object.Reset();
|
||||||
data.GetParameter()->close();
|
data.GetParameter()->close();
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ private:
|
|||||||
static void allocateBuffer(uv_handle_t* handle, size_t suggestedSize, uv_buf_t* buffer);
|
static void allocateBuffer(uv_handle_t* handle, size_t suggestedSize, uv_buf_t* buffer);
|
||||||
static void onRead(uv_stream_t* stream, ssize_t readSize, const uv_buf_t* buffer);
|
static void onRead(uv_stream_t* stream, ssize_t readSize, const uv_buf_t* buffer);
|
||||||
static void onWrite(uv_write_t* request, int status);
|
static void onWrite(uv_write_t* request, int status);
|
||||||
static void onRelease(const v8::WeakCallbackData<v8::Object, Socket>& data);
|
static void onRelease(const v8::WeakCallbackInfo<Socket>& data);
|
||||||
|
|
||||||
void processTlsShutdown(promiseid_t promise);
|
void processTlsShutdown(promiseid_t promise);
|
||||||
static void onTlsShutdown(uv_write_t* request, int status);
|
static void onTlsShutdown(uv_write_t* request, int status);
|
||||||
|
15
src/Task.cpp
15
src/Task.cpp
@ -62,7 +62,7 @@ struct ImportRecord {
|
|||||||
_task(taskId),
|
_task(taskId),
|
||||||
_owner(owner),
|
_owner(owner),
|
||||||
_useCount(0) {
|
_useCount(0) {
|
||||||
_persistent.SetWeak(this, ImportRecord::onRelease);
|
_persistent.SetWeak(this, ImportRecord::onRelease, v8::WeakCallbackType::kParameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ref() {
|
void ref() {
|
||||||
@ -75,11 +75,11 @@ struct ImportRecord {
|
|||||||
void release() {
|
void release() {
|
||||||
if (--_useCount == 0) {
|
if (--_useCount == 0) {
|
||||||
// All in-flight calls are finished. Make weak.
|
// All in-flight calls are finished. Make weak.
|
||||||
_persistent.SetWeak(this, ImportRecord::onRelease);
|
_persistent.SetWeak(this, ImportRecord::onRelease, v8::WeakCallbackType::kParameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onRelease(const v8::WeakCallbackData<v8::Function, ImportRecord >& data) {
|
static void onRelease(const v8::WeakCallbackInfo<ImportRecord >& data) {
|
||||||
ImportRecord* import = data.GetParameter();
|
ImportRecord* import = data.GetParameter();
|
||||||
import->_owner->releaseExport(import->_task, import->_export);
|
import->_owner->releaseExport(import->_task, import->_export);
|
||||||
for (size_t i = 0; i < import->_owner->_imports.size(); ++i) {
|
for (size_t i = 0; i < import->_owner->_imports.size(); ++i) {
|
||||||
@ -513,11 +513,12 @@ void Task::rejectPromise(promiseid_t promise, v8::Handle<v8::Value> value) {
|
|||||||
exportid_t Task::exportFunction(v8::Handle<v8::Function> function) {
|
exportid_t Task::exportFunction(v8::Handle<v8::Function> function) {
|
||||||
exportid_t exportId = -1;
|
exportid_t exportId = -1;
|
||||||
v8::Handle<v8::String> exportName = v8::String::NewFromUtf8(_isolate, "export");
|
v8::Handle<v8::String> exportName = v8::String::NewFromUtf8(_isolate, "export");
|
||||||
|
v8::Local<v8::Private> privateKey = v8::Private::ForApi(_isolate, exportName);
|
||||||
|
|
||||||
v8::Local<v8::Value> value = function->GetHiddenValue(exportName);
|
v8::MaybeLocal<v8::Value> value = function->GetPrivate(_isolate->GetCurrentContext(), privateKey);
|
||||||
if (!value.IsEmpty() && value->IsNumber())
|
if (!value.IsEmpty() && value.ToLocalChecked()->IsNumber())
|
||||||
{
|
{
|
||||||
exportid_t foundId = value->ToInteger(_isolate)->Int32Value();
|
exportid_t foundId = value.ToLocalChecked()->ToInteger(_isolate)->Int32Value();
|
||||||
if (_exports[foundId]) {
|
if (_exports[foundId]) {
|
||||||
exportId = foundId;
|
exportId = foundId;
|
||||||
}
|
}
|
||||||
@ -528,7 +529,7 @@ exportid_t Task::exportFunction(v8::Handle<v8::Function> function) {
|
|||||||
exportId = _nextExport++;
|
exportId = _nextExport++;
|
||||||
} while (_exports[_nextExport]);
|
} while (_exports[_nextExport]);
|
||||||
ExportRecord* record = new ExportRecord(_isolate, function);
|
ExportRecord* record = new ExportRecord(_isolate, function);
|
||||||
function->SetHiddenValue(exportName, v8::Integer::New(_isolate, exportId));
|
function->SetPrivate(_isolate->GetCurrentContext(), privateKey, v8::Integer::New(_isolate, exportId));
|
||||||
_exports[exportId] = record;
|
_exports[exportId] = record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ void TaskStub::ref() {
|
|||||||
|
|
||||||
void TaskStub::release() {
|
void TaskStub::release() {
|
||||||
if (--_refCount == 0) {
|
if (--_refCount == 0) {
|
||||||
_taskObject.SetWeak(this, onRelease);
|
_taskObject.SetWeak(this, onRelease, v8::WeakCallbackType::kParameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,8 @@ void TaskStub::onProcessExit(uv_process_t* process, int64_t status, int terminat
|
|||||||
uv_close(reinterpret_cast<uv_handle_t*>(process), 0);
|
uv_close(reinterpret_cast<uv_handle_t*>(process), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskStub::onRelease(const v8::WeakCallbackData<v8::Object, TaskStub>& data) {
|
void TaskStub::onRelease(const v8::WeakCallbackInfo<TaskStub>& data) {
|
||||||
|
// XXX?
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskStub::getExports(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
void TaskStub::getExports(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||||
|
@ -54,7 +54,7 @@ private:
|
|||||||
static void kill(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void kill(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
static void statistics(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void statistics(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
|
|
||||||
static void onRelease(const v8::WeakCallbackData<v8::Object, TaskStub>& data);
|
static void onRelease(const v8::WeakCallbackInfo<TaskStub>& data);
|
||||||
|
|
||||||
static void onProcessExit(uv_process_t* process, int64_t status, int terminationSignal);
|
static void onProcessExit(uv_process_t* process, int64_t status, int terminationSignal);
|
||||||
};
|
};
|
||||||
|
@ -49,7 +49,7 @@ void TlsContextWrapper::close() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TlsContextWrapper::onRelease(const v8::WeakCallbackData<v8::Object, TlsContextWrapper>& data) {
|
void TlsContextWrapper::onRelease(const v8::WeakCallbackInfo<TlsContextWrapper>& data) {
|
||||||
data.GetParameter()->_object.Reset();
|
data.GetParameter()->_object.Reset();
|
||||||
delete data.GetParameter();
|
delete data.GetParameter();
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ void TlsContextWrapper::ref() {
|
|||||||
void TlsContextWrapper::release() {
|
void TlsContextWrapper::release() {
|
||||||
assert(_refCount >= 1);
|
assert(_refCount >= 1);
|
||||||
if (--_refCount == 0) {
|
if (--_refCount == 0) {
|
||||||
_object.SetWeak(this, onRelease);
|
_object.SetWeak(this, onRelease, v8::WeakCallbackType::kParameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ public:
|
|||||||
static void setPrivateKey(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void setPrivateKey(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
static void addTrustedCertificate(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void addTrustedCertificate(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
|
|
||||||
static void onRelease(const v8::WeakCallbackData<v8::Object, TlsContextWrapper>& data);
|
static void onRelease(const v8::WeakCallbackInfo<TlsContextWrapper>& data);
|
||||||
|
|
||||||
TlsContext* getContext() { return _context; }
|
TlsContext* getContext() { return _context; }
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ kUvBranch = 'v1.9.1'
|
|||||||
kUvWork = 'uv'
|
kUvWork = 'uv'
|
||||||
|
|
||||||
kV8Repository = 'https://github.com/v8/v8.git'
|
kV8Repository = 'https://github.com/v8/v8.git'
|
||||||
kV8Branch = 'branch-heads/5.1'
|
kV8Branch = 'branch-heads/5.2'
|
||||||
kV8Work = 'v8'
|
kV8Work = 'v8'
|
||||||
|
|
||||||
cores = multiprocessing.cpu_count()
|
cores = multiprocessing.cpu_count()
|
||||||
|
Loading…
Reference in New Issue
Block a user