From d571a91e4ae55441b3430a2cab740fe4046c20b2 Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Tue, 10 Sep 2013 06:43:23 +0000 Subject: [PATCH] Remove HandleScope default ctor. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit BUG=chromium:236173 R=bmeurer@chromium.org, svenpanne@chromium.org Review URL: https://codereview.chromium.org/23530045 Patch from Marja Hölttä . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 3 --- src/api.cc | 5 ----- test/cctest/test-heap.cc | 2 +- test/cctest/test-mark-compact.cc | 2 +- test/cctest/test-thread-termination.cc | 7 +++---- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/include/v8.h b/include/v8.h index 55a8ea6..88c81ae 100644 --- a/include/v8.h +++ b/include/v8.h @@ -748,9 +748,6 @@ template class Persistent { */ class V8_EXPORT HandleScope { public: - // TODO(svenpanne) Deprecate me when Chrome is fixed! - HandleScope(); - HandleScope(Isolate* isolate); ~HandleScope(); diff --git a/src/api.cc b/src/api.cc index 1bc80d2..16beb3e 100644 --- a/src/api.cc +++ b/src/api.cc @@ -706,11 +706,6 @@ Local V8::GetEternal(Isolate* v8_isolate, int index) { // --- H a n d l e s --- -HandleScope::HandleScope() { - Initialize(reinterpret_cast(i::Isolate::Current())); -} - - HandleScope::HandleScope(Isolate* isolate) { Initialize(isolate); } diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc index 95e22d4..64075d2 100644 --- a/test/cctest/test-heap.cc +++ b/test/cctest/test-heap.cc @@ -3422,7 +3422,7 @@ TEST(DeferredHandles) { CcTest::InitializeVM(); Isolate* isolate = Isolate::Current(); Heap* heap = isolate->heap(); - v8::HandleScope scope; + v8::HandleScope scope(reinterpret_cast(isolate)); v8::ImplementationUtilities::HandleScopeData* data = isolate->handle_scope_data(); Handle init(heap->empty_string(), isolate); diff --git a/test/cctest/test-mark-compact.cc b/test/cctest/test-mark-compact.cc index 21700f7..33d9230 100644 --- a/test/cctest/test-mark-compact.cc +++ b/test/cctest/test-mark-compact.cc @@ -572,7 +572,7 @@ intptr_t ShortLivingIsolate() { v8::Isolate* isolate = v8::Isolate::New(); { v8::Isolate::Scope isolate_scope(isolate); v8::Locker lock(isolate); - v8::HandleScope handle_scope; + v8::HandleScope handle_scope(isolate); v8::Local context = v8::Context::New(isolate); CHECK(!context.IsEmpty()); } diff --git a/test/cctest/test-thread-termination.cc b/test/cctest/test-thread-termination.cc index 619bce7..b89f3ef 100644 --- a/test/cctest/test-thread-termination.cc +++ b/test/cctest/test-thread-termination.cc @@ -324,11 +324,11 @@ void DoLoopCancelTerminate(const v8::FunctionCallbackInfo& args) { // Test that a single thread of JavaScript execution can terminate // itself and then resume execution. TEST(TerminateCancelTerminateFromThreadItself) { - v8::HandleScope scope; + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); v8::Handle global = CreateGlobalTemplate(TerminateCurrentThread, DoLoopCancelTerminate); - v8::Handle context = - v8::Context::New(v8::Isolate::GetCurrent(), NULL, global); + v8::Handle context = v8::Context::New(isolate, NULL, global); v8::Context::Scope context_scope(context); CHECK(!v8::V8::IsExecutionTerminating()); v8::Handle source = @@ -336,4 +336,3 @@ TEST(TerminateCancelTerminateFromThreadItself) { // Check that execution completed with correct return value. CHECK(v8::Script::Compile(source)->Run()->Equals(v8_str("completed"))); } - -- 2.7.4