Index: src/bootstrapper.cc |
=================================================================== |
--- src/bootstrapper.cc (revision 10744) |
+++ src/bootstrapper.cc (working copy) |
@@ -196,7 +196,7 @@ |
// detached from the other objects in the snapshot. |
void HookUpInnerGlobal(Handle<GlobalObject> inner_global); |
// New context initialization. Used for creating a context from scratch. |
- void InitializeGlobal(Handle<GlobalObject> inner_global, |
+ bool InitializeGlobal(Handle<GlobalObject> inner_global, |
Handle<JSFunction> empty_function); |
void InitializeExperimentalGlobal(); |
// Installs the contents of the native .js files on the global objects. |
@@ -828,7 +828,7 @@ |
// This is only called if we are not using snapshots. The equivalent |
// work in the snapshot case is done in HookUpInnerGlobal. |
-void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
+bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
Handle<JSFunction> empty_function) { |
// --- G l o b a l C o n t e x t --- |
// Use the empty function as closure (no scope info). |
@@ -1032,7 +1032,10 @@ |
Handle<String> name = factory->NewStringFromAscii(CStrVector("JSON")); |
Handle<JSFunction> cons = factory->NewFunction(name, |
factory->the_hole_value()); |
- cons->SetInstancePrototype(global_context()->initial_object_prototype()); |
+ { MaybeObject* result = cons->SetInstancePrototype( |
+ global_context()->initial_object_prototype()); |
+ if (result->IsFailure()) return false; |
+ } |
cons->SetInstanceClassName(*name); |
Handle<JSObject> json_object = factory->NewJSObject(cons, TENURED); |
ASSERT(json_object->IsJSObject()); |
@@ -1243,6 +1246,7 @@ |
global_context()->set_random_seed(*zeroed_byte_array); |
memset(zeroed_byte_array->GetDataStartAddress(), 0, kRandomStateSize); |
} |
+ return true; |
} |
@@ -2314,7 +2318,7 @@ |
Handle<JSGlobalProxy> global_proxy = |
CreateNewGlobals(global_template, global_object, &inner_global); |
HookUpGlobalProxy(inner_global, global_proxy); |
- InitializeGlobal(inner_global, empty_function); |
+ if (!InitializeGlobal(inner_global, empty_function)) return; |
InstallJSFunctionResultCaches(); |
InitializeNormalizedMapCaches(); |
if (!InstallNatives()) return; |