Bootstrapper code for constructed arrays needs to be handlefied

BUG=

Review URL: https://codereview.chromium.org/14008004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14451 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bb2d8a51
......@@ -892,10 +892,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
if (FLAG_optimize_constructed_arrays) {
// Cache the array maps, needed by ArrayConstructorStub
MaybeObject* cache_result = CacheInitialJSArrayMaps(*native_context(),
*initial_map);
if (cache_result->IsFailure()) return false;
CacheInitialJSArrayMaps(native_context(), initial_map);
ArrayConstructorStub array_constructor_stub(isolate);
Handle<Code> code = array_constructor_stub.GetCode(isolate);
array_function->shared()->set_construct_stub(*code);
......
......@@ -8369,7 +8369,7 @@ MaybeObject* JSObject::OptimizeAsPrototype() {
}
MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
static MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
Context* native_context, Map* initial_map) {
// Replace all of the cached initial array maps in the native context with
// the appropriate transitioned elements kind maps.
......@@ -8398,6 +8398,14 @@ MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
}
Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context,
Handle<Map> initial_map) {
CALL_HEAP_FUNCTION(native_context->GetIsolate(),
CacheInitialJSArrayMaps(*native_context, *initial_map),
Object);
}
MaybeObject* JSFunction::SetInstancePrototype(Object* value) {
ASSERT(value->IsJSReceiver());
Heap* heap = GetHeap();
......
......@@ -8753,8 +8753,8 @@ class JSArray: public JSObject {
};
MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
Context* native_context, Map* initial_map);
Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context,
Handle<Map> initial_map);
// JSRegExpResult is just a JSArray with a specific initial map.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment