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

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: Address comments 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
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/js/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index df134ed4b838cce83d6135f0106780e33f59d705..afd3803e42cf10dd8b08505685906dfd237e27da 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -433,9 +433,17 @@ 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.
+ // In order to help CallSite::IsConstructor detect builtin constructors,
+ // we reuse the receiver field to pass along a special symbol.
+ 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));
« no previous file with comments | « 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