Reviewers: Vitaly,
Description:
Remove the early initialization of isolate in HandleScope().
Previously in the branch, I've added EnsureInitialized() to HandleScope
ctor.
Now that we have PreInit(), this is not necessary. The modified tests are
rolled
back to original state.
Please review this at http://codereview.chromium.org/2761008/show
Affected files:
M src/api.cc
M test/cctest/test-serialize.cc
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
6fdf7e5b7a027b135e90a371c5b21b67ad0ba2cb..b83f16479f820a9f0d317ae4c8f43383be04e12d
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -445,9 +445,6 @@ void V8::DisposeGlobal(i::Object** obj) {
HandleScope::HandleScope() : is_closed_(false) {
API_ENTRY_CHECK("HandleScope::HandleScope");
- // Handle scope is per-isolate so we need to initialize the current one
- // if it wasn't already.
- EnsureInitialized("HandleScope::HandleScope");
i::HandleScope::Enter(&previous_);
}
Index: test/cctest/test-serialize.cc
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc
index
5c72c7a82599d666c9a0f8b28a6c05f2a0e2a23f..d9b2f09369c3d4afbb211f0e59317163fe67b278
100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -293,6 +293,7 @@ DEPENDENT_TEST(Deserialize, Serialize) {
// serialization. That doesn't matter. We don't need to be able to
// serialize a snapshot in a VM that is booted from a snapshot.
if (!Snapshot::IsEnabled()) {
+ v8::HandleScope scope;
Deserialize();
v8::Persistent<v8::Context> env = v8::Context::New();
@@ -305,6 +306,7 @@ DEPENDENT_TEST(Deserialize, Serialize) {
DEPENDENT_TEST(DeserializeFromSecondSerialization, SerializeTwice) {
if (!Snapshot::IsEnabled()) {
+ v8::HandleScope scope;
Deserialize();
v8::Persistent<v8::Context> env = v8::Context::New();
@@ -317,12 +319,12 @@ DEPENDENT_TEST(DeserializeFromSecondSerialization,
SerializeTwice) {
DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) {
if (!Snapshot::IsEnabled()) {
+ v8::HandleScope scope;
Deserialize();
v8::Persistent<v8::Context> env = v8::Context::New();
env->Enter();
- v8::HandleScope scope;
const char* c_source = "\"1234\".length";
v8::Local<v8::String> source = v8::String::New(c_source);
v8::Local<v8::Script> script = v8::Script::Compile(source);
@@ -334,12 +336,12 @@ DEPENDENT_TEST(DeserializeAndRunScript2, Serialize) {
DEPENDENT_TEST(DeserializeFromSecondSerializationAndRunScript2,
SerializeTwice) {
if (!Snapshot::IsEnabled()) {
+ v8::HandleScope scope;
Deserialize();
v8::Persistent<v8::Context> env = v8::Context::New();
env->Enter();
- v8::HandleScope scope;
const char* c_source = "\"1234\".length";
v8::Local<v8::String> source = v8::String::New(c_source);
v8::Local<v8::Script> script = v8::Script::Compile(source);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev