From f230a1cf749e984439b5bb9729d9db9f48472827 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 10 Nov 2013 02:02:27 +0100 Subject: v8: upgrade to 3.22.24 This commit removes the simple/test-event-emitter-memory-leak test for being unreliable with the new garbage collector: the memory pressure exerted by the test case is too low for the garbage collector to kick in. It can be made to work again by limiting the heap size with the --max_old_space_size=x flag but that won't be very reliable across platforms and architectures. --- deps/v8/samples/lineprocessor.cc | 10 +++++----- deps/v8/samples/samples.gyp | 8 ++++---- deps/v8/samples/shell.cc | 18 ++++++++++++------ 3 files changed, 21 insertions(+), 15 deletions(-) (limited to 'deps/v8/samples') diff --git a/deps/v8/samples/lineprocessor.cc b/deps/v8/samples/lineprocessor.cc index 42048202fd..5068c885e9 100644 --- a/deps/v8/samples/lineprocessor.cc +++ b/deps/v8/samples/lineprocessor.cc @@ -259,7 +259,7 @@ int RunMain(int argc, char* argv[]) { if (cycle_type == CycleInCpp) { bool res = RunCppCycle(script, - v8::Context::GetCurrent(), + isolate->GetCurrentContext(), report_exceptions); return !res; } else { @@ -296,7 +296,7 @@ bool RunCppCycle(v8::Handle script, v8::HandleScope handle_scope(isolate); v8::Handle input_line = ReadLine(); - if (input_line == v8::Undefined()) { + if (input_line == v8::Undefined(isolate)) { continue; } @@ -306,7 +306,7 @@ bool RunCppCycle(v8::Handle script, v8::Handle result; { v8::TryCatch try_catch; - result = process_fun->Call(v8::Context::GetCurrent()->Global(), + result = process_fun->Call(isolate->GetCurrentContext()->Global(), argc, argv); if (try_catch.HasCaught()) { if (report_exceptions) @@ -417,7 +417,7 @@ void Print(const v8::FunctionCallbackInfo& args) { // function is called. Reads a string from standard input and returns. void ReadLine(const v8::FunctionCallbackInfo& args) { if (args.Length() > 0) { - v8::ThrowException(v8::String::New("Unexpected arguments")); + args.GetIsolate()->ThrowException(v8::String::New("Unexpected arguments")); return; } args.GetReturnValue().Set(ReadLine()); @@ -436,7 +436,7 @@ v8::Handle ReadLine() { res = fgets(buffer, kBufferSize, stdin); } if (res == NULL) { - v8::Handle t = v8::Undefined(); + v8::Handle t = v8::Undefined(v8::Isolate::GetCurrent()); return v8::Handle::Cast(t); } // Remove newline char diff --git a/deps/v8/samples/samples.gyp b/deps/v8/samples/samples.gyp index be7b9ea696..dfc7410070 100644 --- a/deps/v8/samples/samples.gyp +++ b/deps/v8/samples/samples.gyp @@ -28,7 +28,7 @@ { 'variables': { 'v8_code': 1, - 'v8_enable_i18n_support%': 0, + 'v8_enable_i18n_support%': 1, }, 'includes': ['../build/toolchain.gypi', '../build/features.gypi'], 'target_defaults': { @@ -42,13 +42,13 @@ 'conditions': [ ['v8_enable_i18n_support==1', { 'dependencies': [ - '<(DEPTH)/third_party/icu/icu.gyp:icui18n', - '<(DEPTH)/third_party/icu/icu.gyp:icuuc', + '<(icu_gyp_path):icui18n', + '<(icu_gyp_path):icuuc', ], }], ['OS=="win" and v8_enable_i18n_support==1', { 'dependencies': [ - '<(DEPTH)/third_party/icu/icu.gyp:icudata', + '<(icu_gyp_path):icudata', ], }], ], diff --git a/deps/v8/samples/shell.cc b/deps/v8/samples/shell.cc index 710547c341..06bd8f67eb 100644 --- a/deps/v8/samples/shell.cc +++ b/deps/v8/samples/shell.cc @@ -140,17 +140,20 @@ void Print(const v8::FunctionCallbackInfo& args) { // the argument into a JavaScript string. void Read(const v8::FunctionCallbackInfo& args) { if (args.Length() != 1) { - v8::ThrowException(v8::String::New("Bad parameters")); + args.GetIsolate()->ThrowException( + v8::String::New("Bad parameters")); return; } v8::String::Utf8Value file(args[0]); if (*file == NULL) { - v8::ThrowException(v8::String::New("Error loading file")); + args.GetIsolate()->ThrowException( + v8::String::New("Error loading file")); return; } v8::Handle source = ReadFile(*file); if (source.IsEmpty()) { - v8::ThrowException(v8::String::New("Error loading file")); + args.GetIsolate()->ThrowException( + v8::String::New("Error loading file")); return; } args.GetReturnValue().Set(source); @@ -165,12 +168,14 @@ void Load(const v8::FunctionCallbackInfo& args) { v8::HandleScope handle_scope(args.GetIsolate()); v8::String::Utf8Value file(args[i]); if (*file == NULL) { - v8::ThrowException(v8::String::New("Error loading file")); + args.GetIsolate()->ThrowException( + v8::String::New("Error loading file")); return; } v8::Handle source = ReadFile(*file); if (source.IsEmpty()) { - v8::ThrowException(v8::String::New("Error loading file")); + args.GetIsolate()->ThrowException( + v8::String::New("Error loading file")); return; } if (!ExecuteString(args.GetIsolate(), @@ -178,7 +183,8 @@ void Load(const v8::FunctionCallbackInfo& args) { v8::String::New(*file), false, false)) { - v8::ThrowException(v8::String::New("Error executing file")); + args.GetIsolate()->ThrowException( + v8::String::New("Error executing file")); return; } } -- cgit v1.2.3