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

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

Issue 1589323002: [runtime] Unify the ToObject handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index d94c75fa0e135cf11f4d9fe1cd270124eeb891d5..ab013037689c092fc9bd2a10cdb5b55e987b5e58 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -702,25 +702,7 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
// Add the receiver (same as in function frame).
Handle<Object> receiver(it.frame()->receiver(), isolate);
DCHECK(!function->shared()->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 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 = function->context();
- Handle<Context> native_context(Context::cast(context->native_context()));
- if (!Object::ToObject(isolate, receiver, native_context)
- .ToHandle(&receiver)) {
- // This only happens if the receiver is forcibly set in %_CallFunction.
- return heap->undefined_value();
- }
- }
- }
+ DCHECK_IMPLIES(is_sloppy(shared->language_mode()), receiver->IsJSReceiver());
details->set(kFrameDetailsReceiverIndex, *receiver);
DCHECK_EQ(details_size, details_index);
« src/builtins.cc ('K') | « src/objects.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698