Version 3.17.11
Added a version of the v8::HandleScope constructor with an v8::Isolate parameter and made AdjustAmountOfExternalAllocatedMemory an instance method of v8::Isolate. (issue 2487)
Fixed two register allocator bugs (off-by-one error/failure propagation). (issue 2576)
Fixed huge heap snapshot when a heavily shared context has many variables. (Chromium issue 145687)
Performance and stability improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@13956 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/test/cctest/test-compiler.cc b/test/cctest/test-compiler.cc
index f6632d4..6c100b0 100644
--- a/test/cctest/test-compiler.cc
+++ b/test/cctest/test-compiler.cc
@@ -67,7 +67,7 @@
v8::Handle<v8::Value> PrintExtension::Print(const v8::Arguments& args) {
for (int i = 0; i < args.Length(); i++) {
if (i != 0) printf(" ");
- v8::HandleScope scope;
+ v8::HandleScope scope(args.GetIsolate());
v8::String::Utf8Value str(args[i]);
if (*str == NULL) return v8::Undefined();
printf("%s", *str);
@@ -83,12 +83,10 @@
static void InitializeVM() {
if (env.IsEmpty()) {
- v8::HandleScope scope;
const char* extensions[] = { "v8/print", "v8/gc" };
v8::ExtensionConfiguration config(2, extensions);
env = v8::Context::New(&config);
}
- v8::HandleScope scope;
env->Enter();
}
@@ -145,7 +143,7 @@
TEST(Inc) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
CHECK_EQ(4.0, Inc(3));
}
@@ -166,7 +164,7 @@
TEST(Add) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
CHECK_EQ(5.0, Add(2, 3));
}
@@ -186,7 +184,7 @@
TEST(Abs) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
CHECK_EQ(3.0, Abs(-3));
}
@@ -207,14 +205,14 @@
TEST(Sum) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
CHECK_EQ(5050.0, Sum(100));
}
TEST(Print) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
const char* source = "for (n = 0; n < 100; ++n) print(n, 1, 2);";
Handle<JSFunction> fun = Compile(source);
if (fun.is_null()) return;
@@ -229,7 +227,7 @@
// tests all the functionality I have added to the compiler today
TEST(Stuff) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
const char* source =
"r = 0;\n"
"a = new Object;\n"
@@ -261,7 +259,7 @@
TEST(UncaughtThrow) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
const char* source = "throw 42;";
Handle<JSFunction> fun = Compile(source);
@@ -283,7 +281,7 @@
// | C-to-JS |
TEST(C2JSFrames) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
const char* source = "function foo(a) { gc(), print(a); }";
@@ -320,7 +318,7 @@
// source resulted in crash.
TEST(Regression236) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
Handle<Script> script = FACTORY->NewScript(FACTORY->empty_string());
script->set_source(HEAP->undefined_value());
@@ -332,7 +330,7 @@
TEST(GetScriptLineNumber) {
LocalContext env;
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
v8::ScriptOrigin origin = v8::ScriptOrigin(v8::String::New("test"));
const char function_f[] = "function f() {}";
const int max_rows = 1000;
@@ -362,7 +360,7 @@
if (!FLAG_cache_optimized_code) return;
FLAG_allow_natives_syntax = true;
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
for (int i = 0; i < 10; i++) {
LocalContext env;
env->Global()->Set(v8::String::New("x"), v8::Integer::New(i));
@@ -425,8 +423,8 @@
TEST(SplitConstantsInFullCompiler) {
- v8::HandleScope scope;
LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
CompileRun("function f() { a = 12345678 }; f();");
CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));