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

Unified Diff: src/bootstrapper.cc

Issue 1496333002: Support intriscDefaultProto for Error functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mark test262 test as fixed Created 5 years 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') | 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 8a96ac0412952df70157ca93263aee63de0e4703..52370bdbee846015e1e33fea8b9f0f624b8154d9 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1127,8 +1127,8 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
CacheInitialJSArrayMaps(native_context(), initial_strong_map);
SimpleInstallFunction(array_function,
- factory->NewStringFromAsciiChecked("isArray"),
- Builtins::kArrayIsArray, 1, true);
+ isolate->factory()->InternalizeUtf8String("isArray"),
+ Builtins::kArrayIsArray, 1, true);
}
{ // --- N u m b e r ---
@@ -1234,6 +1234,62 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
num_fields * kPointerSize);
}
+ { // -- E r r o r
+ Handle<JSFunction> error_fun = InstallFunction(
+ global, "Error", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ InstallWithIntrinsicDefaultProto(isolate, error_fun,
+ Context::ERROR_FUNCTION_INDEX);
+ }
+
+ { // -- E v a l E r r o r
+ Handle<JSFunction> eval_error_fun = InstallFunction(
+ global, "EvalError", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ InstallWithIntrinsicDefaultProto(isolate, eval_error_fun,
+ Context::EVAL_ERROR_FUNCTION_INDEX);
+ }
+
+ { // -- R a n g e E r r o r
+ Handle<JSFunction> range_error_fun = InstallFunction(
+ global, "RangeError", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ InstallWithIntrinsicDefaultProto(isolate, range_error_fun,
+ Context::RANGE_ERROR_FUNCTION_INDEX);
+ }
+
+ { // -- R e f e r e n c e E r r o r
+ Handle<JSFunction> reference_error_fun = InstallFunction(
+ global, "ReferenceError", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ InstallWithIntrinsicDefaultProto(isolate, reference_error_fun,
+ Context::REFERENCE_ERROR_FUNCTION_INDEX);
+ }
+
+ { // -- S y n t a x E r r o r
+ Handle<JSFunction> syntax_error_fun = InstallFunction(
+ global, "SyntaxError", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ InstallWithIntrinsicDefaultProto(isolate, syntax_error_fun,
+ Context::SYNTAX_ERROR_FUNCTION_INDEX);
+ }
+
+ { // -- T y p e E r r o r
+ Handle<JSFunction> type_error_fun = InstallFunction(
+ global, "TypeError", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ InstallWithIntrinsicDefaultProto(isolate, type_error_fun,
+ Context::TYPE_ERROR_FUNCTION_INDEX);
+ }
+
+ { // -- U R I E r r o r
+ Handle<JSFunction> uri_error_fun = InstallFunction(
+ global, "URIError", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ InstallWithIntrinsicDefaultProto(isolate, uri_error_fun,
+ Context::URI_ERROR_FUNCTION_INDEX);
+ }
+
// Initialize the embedder data slot.
Handle<FixedArray> embedder_data = factory->NewFixedArray(3);
native_context()->set_embedder_data(*embedder_data);
@@ -2664,8 +2720,7 @@ bool Genesis::InstallSpecialObjects(Handle<Context> native_context) {
Handle<JSGlobalObject> global(JSGlobalObject::cast(
native_context->global_object()));
- Handle<JSObject> Error = Handle<JSObject>::cast(
- Object::GetProperty(isolate, global, "Error").ToHandleChecked());
+ Handle<JSObject> Error = isolate->error_function();
Handle<String> name =
factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit"));
Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate);
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698