Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: src/runtime/runtime-debug.cc

Issue 1406493002: Debugger: for frame details, use callee context to wrap receiver. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index f47d47b8f39862bd6b7b95fca10f7415944999b2..a112849433050fb2718e109e5e6eb40322ff5966 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -704,22 +704,19 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
}
// Add the receiver (same as in function frame).
- // THIS MUST BE DONE LAST SINCE WE MIGHT ADVANCE
- // THE FRAME ITERATOR TO WRAP THE RECEIVER.
Handle<Object> receiver(it.frame()->receiver(), isolate);
DCHECK(!function->IsBuiltin());
if (!receiver->IsJSObject() && is_sloppy(shared->language_mode())) {
- // If the receiver is not a JSObject and the function is not a
- // builtin or strict-mode we have hit an optimization where a
- // value object is not converted into a wrapped JS objects. To
- // hide this optimization from the debugger, we wrap the receiver
- // by creating correct wrapper object based on the calling frame's
- // native context.
- it.Advance();
+ // If the receiver is not a JSObject and the function is not a builtin or
+ // strict-mode we have hit an optimization where a value object is not
+ // converted into a wrapped JS objects. To hide this optimization from the
+ // debugger, we wrap the receiver by creating correct wrapper object based
+ // on the function's native context.
+ // See ECMA-262 6.0, 9.2.1.2, 6 b iii.
if (receiver->IsUndefined()) {
receiver = handle(function->global_proxy());
} else {
- Context* context = Context::cast(it.frame()->context());
+ Context* context = function->context();
Handle<Context> native_context(Context::cast(context->native_context()));
if (!Object::ToObject(isolate, receiver, native_context)
.ToHandle(&receiver)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698