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
This commit is contained in:
mvstanton@chromium.org 2013-04-26 10:10:36 +00:00
parent bb2d8a51da
commit c247ac4e51
3 changed files with 12 additions and 7 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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.