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

Unified Diff: src/isolate.cc

Issue 2125163004: Correctly format builtin constructors in stack traces (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@20160704-string-number-builtins
Patch Set: Rebase Created 4 years, 5 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/factory.cc ('k') | src/objects.h » ('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 8d32520252318ceac95219a5f8ea76b8696350a3..77f483c8db28f450a8d547f38aae50c598dec60c 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -446,6 +446,14 @@ Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSReceiver> error_object,
Handle<Object> recv = frames[i].receiver();
Handle<AbstractCode> abstract_code = frames[i].abstract_code();
+ if (frame->type() == StackFrame::BUILTIN) {
+ // Help CallSite::IsConstructor correctly detect hand-written
+ // construct stubs.
+ Code* code = Code::cast(*abstract_code);
+ if (code->is_construct_stub()) {
+ recv = handle(heap()->call_site_constructor_symbol(), this);
+ }
+ }
Handle<Smi> offset(Smi::FromInt(frames[i].code_offset()), this);
elements = MaybeGrow(this, elements, cursor, cursor + 4);
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698