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

Unified Diff: src/bootstrapper.cc

Issue 2206573002: Move NoSideEffectToString to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 4 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/api.cc ('k') | src/builtins/builtins.h » ('j') | no next file with comments »
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 39840310288d26d77d0b2cb56fe8458885977345..71e43d48efa8f5fcf480a037f355ef7d14306042 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1003,12 +1003,19 @@ static void InstallError(Isolate* isolate, Handle<JSObject> global,
JSObject::AddProperty(prototype, factory->constructor_string(), error_fun,
DONT_ENUM);
- Handle<JSFunction> to_string_fun =
- SimpleInstallFunction(prototype, factory->toString_string(),
- Builtins::kErrorPrototypeToString, 0, true);
- to_string_fun->shared()->set_native(true);
+ if (context_index == Context::ERROR_FUNCTION_INDEX) {
+ Handle<JSFunction> to_string_fun =
+ SimpleInstallFunction(prototype, factory->toString_string(),
+ Builtins::kErrorPrototypeToString, 0, true);
+ to_string_fun->shared()->set_native(true);
+ isolate->native_context()->set_error_to_string(*to_string_fun);
+ } else {
+ DCHECK(context_index != Context::ERROR_FUNCTION_INDEX);
+ DCHECK(isolate->native_context()->error_to_string()->IsJSFunction());
+
+ InstallFunction(prototype, isolate->error_to_string(),
+ factory->toString_string(), DONT_ENUM);
- if (context_index != Context::ERROR_FUNCTION_INDEX) {
Handle<JSFunction> global_error = isolate->error_function();
CHECK(JSReceiver::SetPrototype(error_fun, global_error, false,
Object::THROW_ON_ERROR)
@@ -2698,6 +2705,13 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
Accessors::FunctionSetPrototype(callsite_fun, proto).Assert();
}
}
+
+ { // -- E r r o r
+ Handle<JSFunction> make_err_fun = InstallFunction(
+ container, "make_generic_error", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ isolate->initial_object_prototype(), Builtins::kMakeGenericError);
+ make_err_fun->shared()->DontAdaptArguments();
+ }
}
« no previous file with comments | « src/api.cc ('k') | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698