From b16d9c28e8dced7c5d7a3b528075ce7f4b03325b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 6 May 2015 17:04:07 +0200 Subject: [PATCH] deps: upgrade v8 to 4.2.77.20 Fixes: https://github.com/iojs/io.js/issues/1637 PR-URL: https://github.com/iojs/io.js/pull/1639 Reviewed-By: Trevor Norris V8-Bug: https://code.google.com/p/v8/issues/detail?id=3960 V8-Bug: https://code.google.com/p/v8/issues/detail?id=4079 --- deps/v8/include/v8-version.h | 2 +- deps/v8/src/compiler.cc | 2 +- deps/v8/src/compiler/graph-visualizer.h | 1 + deps/v8/src/debug.cc | 41 ++++++++++++------- deps/v8/src/factory.cc | 9 +--- deps/v8/src/heap/heap.h | 8 ++++ deps/v8/src/liveedit.cc | 1 + deps/v8/src/runtime/runtime-debug.cc | 10 +++++ deps/v8/src/runtime/runtime.h | 2 +- deps/v8/src/serialize.cc | 2 + deps/v8/test/mjsunit/debug-breakpoints.js | 2 + deps/v8/test/mjsunit/debug-liveedit-2.js | 2 +- deps/v8/test/mjsunit/debug-liveedit-4.js | 2 +- deps/v8/test/mjsunit/deserialize-script-id.js | 17 ++++++++ deps/v8/test/mjsunit/regress/regress-2825.js | 2 +- 15 files changed, 76 insertions(+), 27 deletions(-) create mode 100644 deps/v8/test/mjsunit/deserialize-script-id.js diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 5f59b89dc865a0..f10bf50780a9cb 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 4 #define V8_MINOR_VERSION 2 #define V8_BUILD_NUMBER 77 -#define V8_PATCH_LEVEL 18 +#define V8_PATCH_LEVEL 20 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc index d794ae2b204ec3..2bad9e69ea6768 100644 --- a/deps/v8/src/compiler.cc +++ b/deps/v8/src/compiler.cc @@ -1455,7 +1455,7 @@ Handle Compiler::BuildFunctionInfo( result->set_is_toplevel(false); RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result); - result->set_allows_lazy_compilation(allow_lazy); + result->set_allows_lazy_compilation(literal->AllowsLazyCompilation()); result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx); // Set the expected number of properties for instances and return diff --git a/deps/v8/src/compiler/graph-visualizer.h b/deps/v8/src/compiler/graph-visualizer.h index 17094c23c57c37..0e6a6471b84a63 100644 --- a/deps/v8/src/compiler/graph-visualizer.h +++ b/deps/v8/src/compiler/graph-visualizer.h @@ -5,6 +5,7 @@ #ifndef V8_COMPILER_GRAPH_VISUALIZER_H_ #define V8_COMPILER_GRAPH_VISUALIZER_H_ +#include #include namespace v8 { diff --git a/deps/v8/src/debug.cc b/deps/v8/src/debug.cc index 324d96f333fa21..a7bf7655814ec5 100644 --- a/deps/v8/src/debug.cc +++ b/deps/v8/src/debug.cc @@ -1604,23 +1604,22 @@ Handle Debug::GetSourceBreakLocations( Handle locations = isolate->factory()->NewFixedArray(debug_info->GetBreakPointCount()); int count = 0; - for (int i = 0; i < debug_info->break_points()->length(); i++) { + for (int i = 0; i < debug_info->break_points()->length(); ++i) { if (!debug_info->break_points()->get(i)->IsUndefined()) { BreakPointInfo* break_point_info = BreakPointInfo::cast(debug_info->break_points()->get(i)); - if (break_point_info->GetBreakPointCount() > 0) { - Smi* position = NULL; - switch (position_alignment) { - case STATEMENT_ALIGNED: - position = break_point_info->statement_position(); - break; - case BREAK_POSITION_ALIGNED: - position = break_point_info->source_position(); - break; - } - - locations->set(count++, position); + int break_points = break_point_info->GetBreakPointCount(); + if (break_points == 0) continue; + Smi* position = NULL; + switch (position_alignment) { + case STATEMENT_ALIGNED: + position = break_point_info->statement_position(); + break; + case BREAK_POSITION_ALIGNED: + position = break_point_info->source_position(); + break; } + for (int j = 0; j < break_points; ++j) locations->set(count++, position); } } return locations; @@ -1923,7 +1922,6 @@ static void RecompileAndRelocateSuspendedGenerators( static bool SkipSharedFunctionInfo(SharedFunctionInfo* shared, Object* active_code_marker) { if (!shared->allows_lazy_compilation()) return true; - if (!shared->script()->IsScript()) return true; Object* script = shared->script(); if (!script->IsScript()) return true; if (Script::cast(script)->type()->value() == Script::TYPE_NATIVE) return true; @@ -2204,6 +2202,21 @@ Object* Debug::FindSharedFunctionInfoInScript(Handle