v8: upgrade to 3.11.10.15
This commit is contained in:
parent
7397ab2cf1
commit
a0a0062d61
11
deps/v8/build/common.gypi
vendored
11
deps/v8/build/common.gypi
vendored
@ -239,6 +239,7 @@
|
|||||||
'WIN32',
|
'WIN32',
|
||||||
],
|
],
|
||||||
'msvs_configuration_attributes': {
|
'msvs_configuration_attributes': {
|
||||||
|
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
|
||||||
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
|
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
|
||||||
'CharacterSet': '1',
|
'CharacterSet': '1',
|
||||||
},
|
},
|
||||||
@ -270,7 +271,7 @@
|
|||||||
'target_conditions': [
|
'target_conditions': [
|
||||||
['_toolset=="host"', {
|
['_toolset=="host"', {
|
||||||
'variables': {
|
'variables': {
|
||||||
'm32flag': '<!((echo | $(echo ${CXX_host:-$(which g++)}) -m32 -E - > /dev/null 2>&1) && echo "-m32" || true)',
|
'm32flag': '<!((echo | $(echo ${CXX_host:-$(which g++)}) -m32 -E - > /dev/null 2>&1) && echo -n "-m32" || true)',
|
||||||
},
|
},
|
||||||
'cflags': [ '<(m32flag)' ],
|
'cflags': [ '<(m32flag)' ],
|
||||||
'ldflags': [ '<(m32flag)' ],
|
'ldflags': [ '<(m32flag)' ],
|
||||||
@ -280,7 +281,7 @@
|
|||||||
}],
|
}],
|
||||||
['_toolset=="target"', {
|
['_toolset=="target"', {
|
||||||
'variables': {
|
'variables': {
|
||||||
'm32flag': '<!((echo | $(echo ${CXX_target:-${CXX:-$(which g++)}}) -m32 -E - > /dev/null 2>&1) && echo "-m32" || true)',
|
'm32flag': '<!((echo | $(echo ${CXX_target:-${CXX:-$(which g++)}}) -m32 -E - > /dev/null 2>&1) && echo -n "-m32" || true)',
|
||||||
},
|
},
|
||||||
'cflags': [ '<(m32flag)' ],
|
'cflags': [ '<(m32flag)' ],
|
||||||
'ldflags': [ '<(m32flag)' ],
|
'ldflags': [ '<(m32flag)' ],
|
||||||
@ -323,7 +324,7 @@
|
|||||||
},
|
},
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
|
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
|
||||||
'cflags': [ '-Wno-unused-parameter',
|
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
|
||||||
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
|
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
@ -332,6 +333,10 @@
|
|||||||
'conditions': [
|
'conditions': [
|
||||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
|
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
|
||||||
or OS=="android"', {
|
or OS=="android"', {
|
||||||
|
'cflags!': [
|
||||||
|
'-O2',
|
||||||
|
'-Os',
|
||||||
|
],
|
||||||
'cflags': [
|
'cflags': [
|
||||||
'-fdata-sections',
|
'-fdata-sections',
|
||||||
'-ffunction-sections',
|
'-ffunction-sections',
|
||||||
|
52
deps/v8/src/debug.cc
vendored
52
deps/v8/src/debug.cc
vendored
@ -892,16 +892,6 @@ void Debug::Iterate(ObjectVisitor* v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Debug::PutValuesOnStackAndDie(int start,
|
|
||||||
Address c_entry_fp,
|
|
||||||
Address last_fp,
|
|
||||||
Address larger_fp,
|
|
||||||
int count,
|
|
||||||
int end) {
|
|
||||||
OS::Abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Object* Debug::Break(Arguments args) {
|
Object* Debug::Break(Arguments args) {
|
||||||
Heap* heap = isolate_->heap();
|
Heap* heap = isolate_->heap();
|
||||||
HandleScope scope(isolate_);
|
HandleScope scope(isolate_);
|
||||||
@ -999,41 +989,17 @@ Object* Debug::Break(Arguments args) {
|
|||||||
it.Advance();
|
it.Advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Catch the cases that would lead to crashes and capture
|
// Check that we indeed found the frame we are looking for.
|
||||||
// - C entry FP at which to start stack crawl.
|
CHECK(!it.done() && (it.frame()->fp() == thread_local_.last_fp_));
|
||||||
// - FP of the frame at which we plan to stop stepping out (last FP).
|
if (step_count > 1) {
|
||||||
// - current FP that's larger than last FP.
|
// Save old count and action to continue stepping after
|
||||||
// - Counter for the number of steps to step out.
|
// StepOut
|
||||||
if (it.done()) {
|
thread_local_.queued_step_count_ = step_count - 1;
|
||||||
// We crawled the entire stack, never reaching last_fp_.
|
|
||||||
PutValuesOnStackAndDie(0xBEEEEEEE,
|
|
||||||
frame->fp(),
|
|
||||||
thread_local_.last_fp_,
|
|
||||||
NULL,
|
|
||||||
count,
|
|
||||||
0xFEEEEEEE);
|
|
||||||
} else if (it.frame()->fp() != thread_local_.last_fp_) {
|
|
||||||
// We crawled over last_fp_, without getting a match.
|
|
||||||
PutValuesOnStackAndDie(0xBEEEEEEE,
|
|
||||||
frame->fp(),
|
|
||||||
thread_local_.last_fp_,
|
|
||||||
it.frame()->fp(),
|
|
||||||
count,
|
|
||||||
0xFEEEEEEE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we found original frame
|
// Set up for StepOut to reach target frame
|
||||||
if (it.frame()->fp() == thread_local_.last_fp_) {
|
step_action = StepOut;
|
||||||
if (step_count > 1) {
|
step_count = count;
|
||||||
// Save old count and action to continue stepping after
|
|
||||||
// StepOut
|
|
||||||
thread_local_.queued_step_count_ = step_count - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set up for StepOut to reach target frame
|
|
||||||
step_action = StepOut;
|
|
||||||
step_count = count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all current stepping setup.
|
// Clear all current stepping setup.
|
||||||
|
6
deps/v8/src/debug.h
vendored
6
deps/v8/src/debug.h
vendored
@ -232,12 +232,6 @@ class Debug {
|
|||||||
void PreemptionWhileInDebugger();
|
void PreemptionWhileInDebugger();
|
||||||
void Iterate(ObjectVisitor* v);
|
void Iterate(ObjectVisitor* v);
|
||||||
|
|
||||||
NO_INLINE(void PutValuesOnStackAndDie(int start,
|
|
||||||
Address c_entry_fp,
|
|
||||||
Address last_fp,
|
|
||||||
Address larger_fp,
|
|
||||||
int count,
|
|
||||||
int end));
|
|
||||||
Object* Break(Arguments args);
|
Object* Break(Arguments args);
|
||||||
void SetBreakPoint(Handle<SharedFunctionInfo> shared,
|
void SetBreakPoint(Handle<SharedFunctionInfo> shared,
|
||||||
Handle<Object> break_point_object,
|
Handle<Object> break_point_object,
|
||||||
|
6
deps/v8/src/execution.cc
vendored
6
deps/v8/src/execution.cc
vendored
@ -132,6 +132,12 @@ static Handle<Object> Invoke(bool is_construct,
|
|||||||
V8::FatalProcessOutOfMemory("JS", true);
|
V8::FatalProcessOutOfMemory("JS", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_DEBUGGER_SUPPORT
|
||||||
|
// Reset stepping state when script exits with uncaught exception.
|
||||||
|
if (isolate->debugger()->IsDebuggerActive()) {
|
||||||
|
isolate->debug()->ClearStepping();
|
||||||
|
}
|
||||||
|
#endif // ENABLE_DEBUGGER_SUPPORT
|
||||||
return Handle<Object>();
|
return Handle<Object>();
|
||||||
} else {
|
} else {
|
||||||
isolate->clear_pending_message();
|
isolate->clear_pending_message();
|
||||||
|
14
deps/v8/src/runtime.cc
vendored
14
deps/v8/src/runtime.cc
vendored
@ -4842,21 +4842,28 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StoreArrayLiteralElement) {
|
|||||||
// Check whether debugger and is about to step into the callback that is passed
|
// Check whether debugger and is about to step into the callback that is passed
|
||||||
// to a built-in function such as Array.forEach.
|
// to a built-in function such as Array.forEach.
|
||||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) {
|
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) {
|
||||||
if (!isolate->IsDebuggerActive()) return isolate->heap()->false_value();
|
#ifdef ENABLE_DEBUGGER_SUPPORT
|
||||||
|
if (!isolate->IsDebuggerActive() || !isolate->debug()->StepInActive()) {
|
||||||
|
return isolate->heap()->false_value();
|
||||||
|
}
|
||||||
CONVERT_ARG_CHECKED(Object, callback, 0);
|
CONVERT_ARG_CHECKED(Object, callback, 0);
|
||||||
// We do not step into the callback if it's a builtin or not even a function.
|
// We do not step into the callback if it's a builtin or not even a function.
|
||||||
if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) {
|
if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) {
|
||||||
return isolate->heap()->false_value();
|
return isolate->heap()->false_value();
|
||||||
}
|
}
|
||||||
return isolate->heap()->true_value();
|
return isolate->heap()->true_value();
|
||||||
|
#else
|
||||||
|
return isolate->heap()->false_value();
|
||||||
|
#endif // ENABLE_DEBUGGER_SUPPORT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set one shot breakpoints for the callback function that is passed to a
|
// Set one shot breakpoints for the callback function that is passed to a
|
||||||
// built-in function such as Array.forEach to enable stepping into the callback.
|
// built-in function such as Array.forEach to enable stepping into the callback.
|
||||||
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) {
|
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) {
|
||||||
|
#ifdef ENABLE_DEBUGGER_SUPPORT
|
||||||
Debug* debug = isolate->debug();
|
Debug* debug = isolate->debug();
|
||||||
if (!debug->IsStepping()) return NULL;
|
if (!debug->IsStepping()) return isolate->heap()->undefined_value();
|
||||||
CONVERT_ARG_CHECKED(Object, callback, 0);
|
CONVERT_ARG_CHECKED(Object, callback, 0);
|
||||||
HandleScope scope(isolate);
|
HandleScope scope(isolate);
|
||||||
Handle<SharedFunctionInfo> shared_info(JSFunction::cast(callback)->shared());
|
Handle<SharedFunctionInfo> shared_info(JSFunction::cast(callback)->shared());
|
||||||
@ -4865,7 +4872,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) {
|
|||||||
// again, we need to clear the step out at this point.
|
// again, we need to clear the step out at this point.
|
||||||
debug->ClearStepOut();
|
debug->ClearStepOut();
|
||||||
debug->FloodWithOneShot(shared_info);
|
debug->FloodWithOneShot(shared_info);
|
||||||
return NULL;
|
#endif // ENABLE_DEBUGGER_SUPPORT
|
||||||
|
return isolate->heap()->undefined_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
2
deps/v8/src/version.cc
vendored
2
deps/v8/src/version.cc
vendored
@ -35,7 +35,7 @@
|
|||||||
#define MAJOR_VERSION 3
|
#define MAJOR_VERSION 3
|
||||||
#define MINOR_VERSION 11
|
#define MINOR_VERSION 11
|
||||||
#define BUILD_NUMBER 10
|
#define BUILD_NUMBER 10
|
||||||
#define PATCH_LEVEL 14
|
#define PATCH_LEVEL 15
|
||||||
// Use 1 for candidates and 0 otherwise.
|
// Use 1 for candidates and 0 otherwise.
|
||||||
// (Boolean macro values are not supported by all preprocessors.)
|
// (Boolean macro values are not supported by all preprocessors.)
|
||||||
#define IS_CANDIDATE_VERSION 0
|
#define IS_CANDIDATE_VERSION 0
|
||||||
|
43
deps/v8/test/cctest/test-debug.cc
vendored
43
deps/v8/test/cctest/test-debug.cc
vendored
@ -7350,4 +7350,47 @@ TEST(DebugBreakInline) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void DebugEventStepNext(v8::DebugEvent event,
|
||||||
|
v8::Handle<v8::Object> exec_state,
|
||||||
|
v8::Handle<v8::Object> event_data,
|
||||||
|
v8::Handle<v8::Value> data) {
|
||||||
|
if (event == v8::Break) {
|
||||||
|
PrepareStep(StepNext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void RunScriptInANewCFrame(const char* source) {
|
||||||
|
v8::TryCatch try_catch;
|
||||||
|
CompileRun(source);
|
||||||
|
CHECK(try_catch.HasCaught());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST(Regress131642) {
|
||||||
|
// Bug description:
|
||||||
|
// When doing StepNext through the first script, the debugger is not reset
|
||||||
|
// after exiting through exception. A flawed implementation enabling the
|
||||||
|
// debugger to step into Array.prototype.forEach breaks inside the callback
|
||||||
|
// for forEach in the second script under the assumption that we are in a
|
||||||
|
// recursive call. In an attempt to step out, we crawl the stack using the
|
||||||
|
// recorded frame pointer from the first script and fail when not finding it
|
||||||
|
// on the stack.
|
||||||
|
v8::HandleScope scope;
|
||||||
|
DebugLocalContext env;
|
||||||
|
v8::Debug::SetDebugEventListener(DebugEventStepNext);
|
||||||
|
|
||||||
|
// We step through the first script. It exits through an exception. We run
|
||||||
|
// this inside a new frame to record a different FP than the second script
|
||||||
|
// would expect.
|
||||||
|
const char* script_1 = "debugger; throw new Error();";
|
||||||
|
RunScriptInANewCFrame(script_1);
|
||||||
|
|
||||||
|
// The second script uses forEach.
|
||||||
|
const char* script_2 = "[0].forEach(function() { });";
|
||||||
|
CompileRun(script_2);
|
||||||
|
|
||||||
|
v8::Debug::SetDebugEventListener(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // ENABLE_DEBUGGER_SUPPORT
|
#endif // ENABLE_DEBUGGER_SUPPORT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user