From 3fb3ca8c7ca439d408449a395897395c0faae8d1 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 2 Dec 2011 17:19:32 +0000 Subject: Upgrade to V8 3.4 Merge 3.4.14.35 Simple merge required updates to makefiles only. Bug: 568872 Change-Id: I403a38452c547e06fcfa951c12eca12a1bc40978 --- src/mirror-debugger.js | 60 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 7 deletions(-) (limited to 'src/mirror-debugger.js') diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js index 3a035351..bad08002 100644 --- a/src/mirror-debugger.js +++ b/src/mirror-debugger.js @@ -1243,13 +1243,17 @@ const kFrameDetailsLocalCountIndex = 4; const kFrameDetailsSourcePositionIndex = 5; const kFrameDetailsConstructCallIndex = 6; const kFrameDetailsAtReturnIndex = 7; -const kFrameDetailsDebuggerFrameIndex = 8; +const kFrameDetailsFlagsIndex = 8; const kFrameDetailsFirstDynamicIndex = 9; const kFrameDetailsNameIndex = 0; const kFrameDetailsValueIndex = 1; const kFrameDetailsNameValueSize = 2; +const kFrameDetailsFlagDebuggerFrameMask = 1 << 0; +const kFrameDetailsFlagOptimizedFrameMask = 1 << 1; +const kFrameDetailsFlagInlinedFrameIndexMask = 7 << 2; + /** * Wrapper for the frame details information retreived from the VM. The frame * details from the VM is an array with the following content. See runtime.cc @@ -1262,7 +1266,7 @@ const kFrameDetailsNameValueSize = 2; * 5: Source position * 6: Construct call * 7: Is at return - * 8: Debugger frame + * 8: Flags (debugger frame, optimized frame, inlined frame index) * Arguments name, value * Locals name, value * Return value if any @@ -1308,7 +1312,27 @@ FrameDetails.prototype.isAtReturn = function() { FrameDetails.prototype.isDebuggerFrame = function() { %CheckExecutionState(this.break_id_); - return this.details_[kFrameDetailsDebuggerFrameIndex]; + var f = kFrameDetailsFlagDebuggerFrameMask; + return (this.details_[kFrameDetailsFlagsIndex] & f) == f; +} + + +FrameDetails.prototype.isOptimizedFrame = function() { + %CheckExecutionState(this.break_id_); + var f = kFrameDetailsFlagOptimizedFrameMask; + return (this.details_[kFrameDetailsFlagsIndex] & f) == f; +} + + +FrameDetails.prototype.isInlinedFrame = function() { + return this.inlinedFrameIndex() > 0; +} + + +FrameDetails.prototype.inlinedFrameIndex = function() { + %CheckExecutionState(this.break_id_); + var f = kFrameDetailsFlagInlinedFrameIndexMask; + return (this.details_[kFrameDetailsFlagsIndex] & f) >> 2 } @@ -1447,6 +1471,21 @@ FrameMirror.prototype.isDebuggerFrame = function() { }; +FrameMirror.prototype.isOptimizedFrame = function() { + return this.details_.isOptimizedFrame(); +}; + + +FrameMirror.prototype.isInlinedFrame = function() { + return this.details_.isInlinedFrame(); +}; + + +FrameMirror.prototype.inlinedFrameIndex = function() { + return this.details_.inlinedFrameIndex(); +}; + + FrameMirror.prototype.argumentCount = function() { return this.details_.argumentCount(); }; @@ -1536,8 +1575,12 @@ FrameMirror.prototype.scope = function(index) { FrameMirror.prototype.evaluate = function(source, disable_break, opt_context_object) { - var result = %DebugEvaluate(this.break_id_, this.details_.frameId(), - source, Boolean(disable_break), opt_context_object); + var result = %DebugEvaluate(this.break_id_, + this.details_.frameId(), + this.details_.inlinedFrameIndex(), + source, + Boolean(disable_break), + opt_context_object); return MakeMirror(result); }; @@ -1562,8 +1605,10 @@ FrameMirror.prototype.invocationText = function() { // Try to find the function as a property in the receiver. Include the // prototype chain in the lookup. var property = GetUndefinedMirror(); - if (!receiver.isUndefined()) { - for (var r = receiver; !r.isNull() && property.isUndefined(); r = r.protoObject()) { + if (receiver.isObject()) { + for (var r = receiver; + !r.isNull() && property.isUndefined(); + r = r.protoObject()) { property = r.lookupProperty(func); } } @@ -1690,6 +1735,7 @@ function ScopeDetails(frame, index) { this.break_id_ = frame.break_id_; this.details_ = %GetScopeDetails(frame.break_id_, frame.details_.frameId(), + frame.details_.inlinedFrameIndex(), index); } -- cgit v1.2.3