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

Unified Diff: src/isolate.cc

Issue 2106883003: [builtins] Add receiver to builtin exit frames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove patch dependency Created 4 years, 6 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/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index df134ed4b838cce83d6135f0106780e33f59d705..4b673f1a920f2381bd161a90291fba7f3387eee9 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -433,9 +433,18 @@ Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSReceiver> error_object,
int offset =
static_cast<int>(exit_frame->pc() - code->instruction_start());
- // For now, builtin exit frames do not pass along a receiver.
+ // CallSite::IsConstructor does not correctly detect builtin
Yang 2016/06/30 12:34:23 Isn't this comment outdated now that you actually
jgruber 2016/06/30 14:40:29 Done.
+ // constructors. Instead, we reuse the receiver field to pass along a
+ // special symbol marking builtin constructors.
+ Handle<Object> recv;
+ if (exit_frame->IsConstructor()) {
+ recv = handle(heap()->call_site_constructor_symbol(), this);
+ } else {
+ recv = handle(exit_frame->receiver(), this);
+ }
+
elements = MaybeGrow(this, elements, cursor, cursor + 4);
- elements->set(cursor++, *factory()->undefined_value());
+ elements->set(cursor++, *recv);
elements->set(cursor++, *fun);
elements->set(cursor++, *code);
elements->set(cursor++, Smi::FromInt(offset));
« src/builtins.cc ('K') | « src/ia32/builtins-ia32.cc ('k') | src/js/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698