This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Upgrade V8 to 2.3.4

  • Loading branch information...
1 parent 4b19bd2 commit a6bc68a83beda7609330e525a73b7b227a1b9207 @ry ry committed Aug 3, 2010
Showing with 1,938 additions and 526 deletions.
  1. +25 −0 deps/v8/ChangeLog
  2. +1 −0 deps/v8/src/arm/codegen-arm.cc
  3. +3 −2 deps/v8/src/arm/debug-arm.cc
  4. +1 −1 deps/v8/src/arm/full-codegen-arm.cc
  5. +3 −2 deps/v8/src/arm/virtual-frame-arm.cc
  6. +1 −1 deps/v8/src/codegen.cc
  7. +63 −7 deps/v8/src/debug-debugger.js
  8. +49 −31 deps/v8/src/debug.cc
  9. +32 −5 deps/v8/src/debug.h
  10. +1 −1 deps/v8/src/full-codegen.cc
  11. +6 −0 deps/v8/src/global-handles.cc
  12. +7 −7 deps/v8/src/ia32/codegen-ia32.cc
  13. +11 −2 deps/v8/src/ia32/debug-ia32.cc
  14. +1 −1 deps/v8/src/ia32/full-codegen-ia32.cc
  15. +14 −17 deps/v8/src/ia32/macro-assembler-ia32.cc
  16. +4 −4 deps/v8/src/ia32/macro-assembler-ia32.h
  17. +10 −11 deps/v8/src/ia32/stub-cache-ia32.cc
  18. +24 −57 deps/v8/src/jsregexp.cc
  19. +0 −1 deps/v8/src/jsregexp.h
  20. +11 −4 deps/v8/src/liveedit.cc
  21. +3 −2 deps/v8/src/mips/debug-mips.cc
  22. +21 −11 deps/v8/src/runtime.cc
  23. +1 −0 deps/v8/src/runtime.h
  24. +5 −0 deps/v8/src/serialize.cc
  25. +1 −1 deps/v8/src/unicode-inl.h
  26. +1,125 −252 deps/v8/src/unicode.cc
  27. +1 −0 deps/v8/src/unicode.h
  28. +1 −1 deps/v8/src/v8natives.js
  29. +2 −2 deps/v8/src/version.cc
  30. +6 −10 deps/v8/src/x64/assembler-x64.cc
  31. +0 −1 deps/v8/src/x64/assembler-x64.h
  32. +54 −1 deps/v8/src/x64/codegen-x64.cc
  33. +3 −2 deps/v8/src/x64/debug-x64.cc
  34. +4 −4 deps/v8/src/x64/disasm-x64.cc
  35. +1 −1 deps/v8/src/x64/full-codegen-x64.cc
  36. +164 −8 deps/v8/src/x64/macro-assembler-x64.cc
  37. +43 −0 deps/v8/src/x64/macro-assembler-x64.h
  38. +69 −12 deps/v8/src/x64/stub-cache-x64.cc
  39. +2 −2 deps/v8/test/cctest/test-debug.cc
  40. +20 −37 deps/v8/test/cctest/test-regexp.cc
  41. +7 −7 deps/v8/test/mjsunit/debug-breakpoints.js
  42. +5 −5 deps/v8/test/mjsunit/debug-conditional-breakpoints.js
  43. +15 −0 deps/v8/test/mjsunit/debug-enable-disable-breakpoints.js
  44. +1 −1 deps/v8/test/mjsunit/debug-return-value.js
  45. +42 −0 deps/v8/test/mjsunit/regress/regress-784.js
  46. +51 −0 deps/v8/test/mjsunit/regress/regress-806.js
  47. +8 −2 deps/v8/tools/presubmit.py
  48. +16 −10 deps/v8/tools/v8.xcodeproj/project.pbxproj
View
@@ -1,3 +1,28 @@
+2010-08-02: Version 2.3.4
+
+ Fixed problems in implementation of ES5 function.prototype.bind.
+
+ Fixed error when using apply with arguments object on ARM (issue 784).
+
+ Added setting of global flags to debugger protocol.
+
+ Fixed an error affecting cached results of sin and cos (issue 792).
+
+ Removed memory leak from a boundary case where V8 is not initialized.
+
+ Fixed issue where debugger could set breakpoints outside the body
+ of a function.
+
+ Fixed issue in debugger when using both live edit and step in features.
+
+ Added Number-letter (Nl) category to Unicode tables. These characters
+ can now be used in identifiers.
+
+ Fixed an assert failure on X64 (issue 806).
+
+ Performance improvements on all platforms.
+
+
2010-07-26: Version 2.3.3
Fixed error when building the d8 shell in a fresh checkout.
@@ -1628,6 +1628,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
// The function and its two arguments have been dropped.
frame_->Drop(); // Drop the receiver as well.
frame_->EmitPush(r0);
+ frame_->SpillAll(); // A spilled frame is also jumping to label done.
// Stack now has 1 element:
// sp[0]: result
__ bind(&done);
@@ -296,9 +296,10 @@ void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
#undef __
-void Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
- Handle<Code> code) {
+Object** Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
+ Handle<Code> code) {
UNREACHABLE();
+ return NULL;
}
const int Debug::kFrameDropperFrameSize = -1;
@@ -224,7 +224,7 @@ void FullCodeGenerator::EmitReturnSequence() {
// Here we use masm_-> instead of the __ macro to avoid the code coverage
// tool from instrumenting as we rely on the code size here.
int32_t sp_delta = (scope()->num_parameters() + 1) * kPointerSize;
- CodeGenerator::RecordPositions(masm_, function()->end_position());
+ CodeGenerator::RecordPositions(masm_, function()->end_position() - 1);
__ RecordJSReturn();
masm_->mov(sp, fp);
masm_->ldm(ia_w, sp, fp.bit() | lr.bit());
@@ -562,9 +562,10 @@ Register VirtualFrame::Peek2() {
case R1_R0_TOS:
MergeTOSTo(R1_R0_TOS);
return r0;
+ default:
+ UNREACHABLE();
+ return no_reg;
}
- UNREACHABLE();
- return no_reg;
}
View
@@ -433,7 +433,7 @@ void CodeGenerator::CodeForFunctionPosition(FunctionLiteral* fun) {
void CodeGenerator::CodeForReturnPosition(FunctionLiteral* fun) {
- if (FLAG_debug_info) RecordPositions(masm(), fun->end_position(), false);
+ if (FLAG_debug_info) RecordPositions(masm(), fun->end_position() - 1, false);
}
@@ -79,6 +79,16 @@ var next_response_seq = 0;
var next_break_point_number = 1;
var break_points = [];
var script_break_points = [];
+var debugger_flags = {
+ breakPointsActive: {
+ value: true,
+ getValue: function() { return this.value; },
+ setValue: function(value) {
+ this.value = !!value;
+ %SetDisableBreak(!this.value);
+ }
+ }
+};
// Create a new break point object and add it to the list of break points.
@@ -246,7 +256,7 @@ ScriptBreakPoint.prototype.cloneForOtherScript = function (other_script) {
other_script.id, this.line_, this.column_, this.groupId_);
copy.number_ = next_break_point_number++;
script_break_points.push(copy);
-
+
copy.hit_count_ = this.hit_count_;
copy.active_ = this.active_;
copy.condition_ = this.condition_;
@@ -813,7 +823,13 @@ Debug.showBreakPoints = function(f, full) {
Debug.scripts = function() {
// Collect all scripts in the heap.
return %DebugGetLoadedScripts();
-}
+};
+
+
+Debug.debuggerFlags = function() {
+ return debugger_flags;
+};
+
function MakeExecutionState(break_id) {
return new ExecutionState(break_id);
@@ -1325,9 +1341,11 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request)
} else if (request.command == 'version') {
this.versionRequest_(request, response);
} else if (request.command == 'profile') {
- this.profileRequest_(request, response);
+ this.profileRequest_(request, response);
} else if (request.command == 'changelive') {
- this.changeLiveRequest_(request, response);
+ this.changeLiveRequest_(request, response);
+ } else if (request.command == 'flags') {
+ this.debuggerFlagsRequest_(request, response);
} else {
throw new Error('Unknown command "' + request.command + '" in request');
}
@@ -1617,6 +1635,7 @@ DebugCommandProcessor.prototype.clearBreakPointRequest_ = function(request, resp
response.body = { breakpoint: break_point }
}
+
DebugCommandProcessor.prototype.listBreakpointsRequest_ = function(request, response) {
var array = [];
for (var i = 0; i < script_break_points.length; i++) {
@@ -1633,7 +1652,7 @@ DebugCommandProcessor.prototype.listBreakpointsRequest_ = function(request, resp
ignoreCount: break_point.ignoreCount(),
actual_locations: break_point.actual_locations()
}
-
+
if (break_point.type() == Debug.ScriptBreakPointType.ScriptId) {
description.type = 'scriptId';
description.script_id = break_point.script_id();
@@ -1643,7 +1662,7 @@ DebugCommandProcessor.prototype.listBreakpointsRequest_ = function(request, resp
}
array.push(description);
}
-
+
response.body = { breakpoints: array }
}
@@ -2086,7 +2105,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
}
var change_log = new Array();
-
+
if (!IS_STRING(request.arguments.new_source)) {
throw "new_source argument expected";
}
@@ -2096,9 +2115,46 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
var result_description = Debug.LiveEdit.SetScriptSource(the_script,
new_source, preview_only, change_log);
response.body = {change_log: change_log, result: result_description};
+
+ if (!preview_only && !this.running_ && result_description.stack_modified) {
+ response.body.stepin_recommended = true;
+ }
};
+DebugCommandProcessor.prototype.debuggerFlagsRequest_ = function(request,
+ response) {
+ // Check for legal request.
+ if (!request.arguments) {
+ response.failed('Missing arguments');
+ return;
+ }
+
+ // Pull out arguments.
+ var flags = request.arguments.flags;
+
+ response.body = { flags: [] };
+ if (!IS_UNDEFINED(flags)) {
+ for (var i = 0; i < flags.length; i++) {
+ var name = flags[i].name;
+ var debugger_flag = debugger_flags[name];
+ if (!debugger_flag) {
+ continue;
+ }
+ if ('value' in flags[i]) {
+ debugger_flag.setValue(flags[i].value);
+ }
+ response.body.flags.push({ name: name, value: debugger_flag.getValue() });
+ }
+ } else {
+ for (var name in debugger_flags) {
+ var value = debugger_flags[name].getValue();
+ response.body.flags.push({ name: name, value: value });
+ }
+ }
+}
+
+
// Check whether the previously processed command caused the VM to become
// running.
DebugCommandProcessor.prototype.isRunning = function() {
View
@@ -170,7 +170,7 @@ void BreakLocationIterator::Next() {
// Set the positions to the end of the function.
if (debug_info_->shared()->HasSourceCode()) {
position_ = debug_info_->shared()->end_position() -
- debug_info_->shared()->start_position();
+ debug_info_->shared()->start_position() - 1;
} else {
position_ = 0;
}
@@ -1224,36 +1224,42 @@ void Debug::PrepareStep(StepAction step_action, int step_count) {
it.FindBreakLocationFromAddress(frame->pc());
// Compute whether or not the target is a call target.
- bool is_call_target = false;
bool is_load_or_store = false;
bool is_inline_cache_stub = false;
+ bool is_at_restarted_function = false;
Handle<Code> call_function_stub;
- if (RelocInfo::IsCodeTarget(it.rinfo()->rmode())) {
- Address target = it.rinfo()->target_address();
- Code* code = Code::GetCodeFromTargetAddress(target);
- if (code->is_call_stub() || code->is_keyed_call_stub()) {
- is_call_target = true;
- }
- if (code->is_inline_cache_stub()) {
- is_inline_cache_stub = true;
- is_load_or_store = !is_call_target;
- }
- // Check if target code is CallFunction stub.
- Code* maybe_call_function_stub = code;
- // If there is a breakpoint at this line look at the original code to
- // check if it is a CallFunction stub.
- if (it.IsDebugBreak()) {
- Address original_target = it.original_rinfo()->target_address();
- maybe_call_function_stub =
- Code::GetCodeFromTargetAddress(original_target);
- }
- if (maybe_call_function_stub->kind() == Code::STUB &&
- maybe_call_function_stub->major_key() == CodeStub::CallFunction) {
- // Save reference to the code as we may need it to find out arguments
- // count for 'step in' later.
- call_function_stub = Handle<Code>(maybe_call_function_stub);
+ if (thread_local_.restarter_frame_function_pointer_ == NULL) {
+ if (RelocInfo::IsCodeTarget(it.rinfo()->rmode())) {
+ bool is_call_target = false;
+ Address target = it.rinfo()->target_address();
+ Code* code = Code::GetCodeFromTargetAddress(target);
+ if (code->is_call_stub() || code->is_keyed_call_stub()) {
+ is_call_target = true;
+ }
+ if (code->is_inline_cache_stub()) {
+ is_inline_cache_stub = true;
+ is_load_or_store = !is_call_target;
+ }
+
+ // Check if target code is CallFunction stub.
+ Code* maybe_call_function_stub = code;
+ // If there is a breakpoint at this line look at the original code to
+ // check if it is a CallFunction stub.
+ if (it.IsDebugBreak()) {
+ Address original_target = it.original_rinfo()->target_address();
+ maybe_call_function_stub =
+ Code::GetCodeFromTargetAddress(original_target);
+ }
+ if (maybe_call_function_stub->kind() == Code::STUB &&
+ maybe_call_function_stub->major_key() == CodeStub::CallFunction) {
+ // Save reference to the code as we may need it to find out arguments
+ // count for 'step in' later.
+ call_function_stub = Handle<Code>(maybe_call_function_stub);
+ }
}
+ } else {
+ is_at_restarted_function = true;
}
// If this is the last break code target step out is the only possibility.
@@ -1282,7 +1288,7 @@ void Debug::PrepareStep(StepAction step_action, int step_count) {
ActivateStepOut(frames_it.frame());
}
} else if (!(is_inline_cache_stub || RelocInfo::IsConstructCall(it.rmode()) ||
- !call_function_stub.is_null())
+ !call_function_stub.is_null() || is_at_restarted_function)
|| step_action == StepNext || step_action == StepMin) {
// Step next or step min.
@@ -1294,9 +1300,18 @@ void Debug::PrepareStep(StepAction step_action, int step_count) {
debug_info->code()->SourceStatementPosition(frame->pc());
thread_local_.last_fp_ = frame->fp();
} else {
- // If it's CallFunction stub ensure target function is compiled and flood
- // it with one shot breakpoints.
- if (!call_function_stub.is_null()) {
+ // If there's restarter frame on top of the stack, just get the pointer
+ // to function which is going to be restarted.
+ if (is_at_restarted_function) {
+ Handle<JSFunction> restarted_function(
+ JSFunction::cast(*thread_local_.restarter_frame_function_pointer_));
+ Handle<SharedFunctionInfo> restarted_shared(
+ restarted_function->shared());
+ FloodWithOneShot(restarted_shared);
+ } else if (!call_function_stub.is_null()) {
+ // If it's CallFunction stub ensure target function is compiled and flood
+ // it with one shot breakpoints.
+
// Find out number of arguments from the stub minor key.
// Reverse lookup required as the minor key cannot be retrieved
// from the code object.
@@ -1767,9 +1782,12 @@ bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) {
void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
- FrameDropMode mode) {
+ FrameDropMode mode,
+ Object** restarter_frame_function_pointer) {
thread_local_.frame_drop_mode_ = mode;
thread_local_.break_frame_id_ = new_break_frame_id;
+ thread_local_.restarter_frame_function_pointer_ =
+ restarter_frame_function_pointer;
}
Oops, something went wrong.

0 comments on commit a6bc68a

Please sign in to comment.