diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-09-08 16:03:35 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-09-08 16:11:20 -0700 |
commit | 03c2f62020e231db8be078d33e836cbe7e015460 (patch) | |
tree | 976bbdb9a68710c6684e24106beff768132e6041 /deps/v8/src/d8.cc | |
parent | 0a127d6a694f2928f91d2ed51ef85a65768fdad3 (diff) | |
download | node-03c2f62020e231db8be078d33e836cbe7e015460.tar.gz |
Upgrade V8 to 3.6.2
Diffstat (limited to 'deps/v8/src/d8.cc')
-rw-r--r-- | deps/v8/src/d8.cc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/deps/v8/src/d8.cc b/deps/v8/src/d8.cc index 5c6043689..93b383d9a 100644 --- a/deps/v8/src/d8.cc +++ b/deps/v8/src/d8.cc @@ -210,6 +210,18 @@ Handle<Value> Shell::Write(const Arguments& args) { } +Handle<Value> Shell::EnableProfiler(const Arguments& args) { + V8::ResumeProfiler(); + return Undefined(); +} + + +Handle<Value> Shell::DisableProfiler(const Arguments& args) { + V8::PauseProfiler(); + return Undefined(); +} + + Handle<Value> Shell::Read(const Arguments& args) { String::Utf8Value file(args[0]); if (*file == NULL) { @@ -656,6 +668,10 @@ Handle<ObjectTemplate> Shell::CreateGlobalTemplate() { global_template->Set(String::New("load"), FunctionTemplate::New(Load)); global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); global_template->Set(String::New("version"), FunctionTemplate::New(Version)); + global_template->Set(String::New("enableProfiler"), + FunctionTemplate::New(EnableProfiler)); + global_template->Set(String::New("disableProfiler"), + FunctionTemplate::New(DisableProfiler)); // Bind the handlers for external arrays. global_template->Set(String::New("Int8Array"), @@ -1021,7 +1037,7 @@ i::Thread::Options SourceGroup::GetThreadOptions() { void SourceGroup::ExecuteInThread() { Isolate* isolate = Isolate::New(); do { - if (next_semaphore_ != NULL) next_semaphore_->Wait(); + if (!next_semaphore_.is_empty()) next_semaphore_->Wait(); { Isolate::Scope iscope(isolate); Locker lock(isolate); @@ -1033,15 +1049,15 @@ void SourceGroup::ExecuteInThread() { } context.Dispose(); } - if (done_semaphore_ != NULL) done_semaphore_->Signal(); + if (!done_semaphore_.is_empty()) done_semaphore_->Signal(); } while (!Shell::options.last_run); isolate->Dispose(); } void SourceGroup::StartExecuteInThread() { - if (thread_ == NULL) { - thread_ = new IsolateThread(this); + if (thread_.is_empty()) { + thread_ = i::SmartPointer<i::Thread>(new IsolateThread(this)); thread_->Start(); } next_semaphore_->Signal(); @@ -1049,10 +1065,9 @@ void SourceGroup::StartExecuteInThread() { void SourceGroup::WaitForThread() { - if (thread_ == NULL) return; + if (thread_.is_empty()) return; if (Shell::options.last_run) { thread_->Join(); - thread_ = NULL; } else { done_semaphore_->Wait(); } |