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

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

Issue 1968263002: Remove unused 'receiver' field from generators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: weaken dcheck Created 4 years, 7 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 | « src/runtime/runtime.h ('k') | src/runtime/runtime-generator.cc » ('j') | 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 94c2992fc2965ac022244d902803ef59390d1ce9..b23499370ba7e0372d027f5da8ea97afa712d65f 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -235,10 +235,6 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate,
result->set(2, *function);
result->set(3, generator->function());
- Handle<String> receiver =
- factory->NewStringFromAsciiChecked("[[GeneratorReceiver]]");
- result->set(4, *receiver);
- result->set(5, generator->receiver());
return factory->NewJSArrayWithElements(result);
} else if (Object::IsPromise(object)) {
Handle<JSObject> promise = Handle<JSObject>::cast(object);
@@ -695,7 +691,14 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
// Add the receiver (same as in function frame).
Handle<Object> receiver(it.frame()->receiver(), isolate);
DCHECK(!function->shared()->IsBuiltin());
- DCHECK_IMPLIES(is_sloppy(shared->language_mode()), receiver->IsJSReceiver());
+ DCHECK_IMPLIES(
+ is_sloppy(shared->language_mode()),
+ receiver->IsJSReceiver() ||
+ // If this frame is a resumed generator, the receiver may be the hole,
+ // but
+ // it will not be observed as such due to forced context allocation.
+ (*receiver == isolate->heap()->the_hole_value() &&
+ function->shared()->is_generator()));
details->set(kFrameDetailsReceiverIndex, *receiver);
DCHECK_EQ(details_size, details_index);
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698