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

Unified Diff: src/bootstrapper.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: 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 | « no previous file | src/isolate.cc » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index c16285af45a4317dc3dba154af9aefdac3f5e91d..867437e387da18d891ed4c6ea35cb4bfccf0a5e4 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1306,8 +1306,9 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
global, "Number", JS_VALUE_TYPE, JSValue::kSize,
isolate->initial_object_prototype(), Builtins::kNumberConstructor);
number_fun->shared()->DontAdaptArguments();
- number_fun->shared()->set_construct_stub(
- *isolate->builtins()->NumberConstructor_ConstructStub());
+ Handle<Code> code = isolate->builtins()->NumberConstructor_ConstructStub();
+ code->set_is_construct_stub(true); // Mark as hand-written construct stub.
+ number_fun->shared()->set_construct_stub(*code);
number_fun->shared()->set_length(1);
InstallWithIntrinsicDefaultProto(isolate, number_fun,
Context::NUMBER_FUNCTION_INDEX);
@@ -1372,8 +1373,9 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Handle<JSFunction> string_fun = InstallFunction(
global, "String", JS_VALUE_TYPE, JSValue::kSize,
isolate->initial_object_prototype(), Builtins::kStringConstructor);
- string_fun->shared()->set_construct_stub(
- *isolate->builtins()->StringConstructor_ConstructStub());
+ Handle<Code> code = isolate->builtins()->StringConstructor_ConstructStub();
+ code->set_is_construct_stub(true);
+ string_fun->shared()->set_construct_stub(*code);
Yang 2016/07/08 07:08:04 Would it make sense to introduce a SharedFunctionI
jgruber 2016/07/08 10:02:41 set_construct_stub is also called on non-builtin s
jgruber 2016/07/08 10:11:59 Disregard my previous comment, I did add SetConstr
string_fun->shared()->DontAdaptArguments();
string_fun->shared()->set_length(1);
InstallWithIntrinsicDefaultProto(isolate, string_fun,
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698