From eb3c1bd6de8c632ef555995791741d08aa6d3479 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Fri, 9 May 2014 16:42:57 +0000 Subject: [PATCH] Remove "force_initial_map" BUG= R=ishell@chromium.org Review URL: https://codereview.chromium.org/267163003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21236 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/bootstrapper.cc | 41 ++++++++++++++++------------------------- src/factory.cc | 14 +++++--------- src/factory.h | 6 ++---- 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index f3a9330..ada6aa1 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -358,8 +358,7 @@ static Handle InstallFunction(Handle target, Handle internalized_name = factory->InternalizeUtf8String(name); Handle call_code = Handle(isolate->builtins()->builtin(call)); Handle function = factory->NewFunction( - maybe_prototype, internalized_name, type, instance_size, call_code, - !maybe_prototype.is_null()); + maybe_prototype, internalized_name, type, instance_size, call_code); PropertyAttributes attributes; if (target->IsJSBuiltinsObject()) { attributes = @@ -708,9 +707,8 @@ Handle Genesis::CreateNewGlobals( Handle name = Handle(heap()->empty_string()); Handle code = Handle(isolate()->builtins()->builtin( Builtins::kIllegal)); - js_global_function = - factory()->NewFunction(name, JS_GLOBAL_OBJECT_TYPE, - JSGlobalObject::kSize, code, true); + js_global_function = factory()->NewFunction( + name, JS_GLOBAL_OBJECT_TYPE, JSGlobalObject::kSize, code); // Change the constructor property of the prototype of the // hidden global function to refer to the Object function. Handle prototype = @@ -742,9 +740,8 @@ Handle Genesis::CreateNewGlobals( Handle name = Handle(heap()->empty_string()); Handle code = Handle(isolate()->builtins()->builtin( Builtins::kIllegal)); - global_proxy_function = - factory()->NewFunction(name, JS_GLOBAL_PROXY_TYPE, - JSGlobalProxy::kSize, code, true); + global_proxy_function = factory()->NewFunction( + name, JS_GLOBAL_PROXY_TYPE, JSGlobalProxy::kSize, code); } else { Handle data = v8::Utils::OpenHandle(*global_template); @@ -1091,7 +1088,7 @@ void Genesis::InitializeGlobal(Handle inner_global, Handle function = factory->NewFunction( MaybeHandle(), arguments_string, JS_OBJECT_TYPE, - JSObject::kHeaderSize, code, false); + JSObject::kHeaderSize, code); ASSERT(!function->has_initial_map()); function->shared()->set_instance_class_name(*arguments_string); function->shared()->set_expected_nof_properties(2); @@ -1230,12 +1227,9 @@ void Genesis::InitializeGlobal(Handle inner_global, // Create a function for the context extension objects. Handle code = Handle( isolate->builtins()->builtin(Builtins::kIllegal)); - Handle context_extension_fun = - factory->NewFunction(factory->empty_string(), - JS_CONTEXT_EXTENSION_OBJECT_TYPE, - JSObject::kHeaderSize, - code, - true); + Handle context_extension_fun = factory->NewFunction( + factory->empty_string(), JS_CONTEXT_EXTENSION_OBJECT_TYPE, + JSObject::kHeaderSize, code); Handle name = factory->InternalizeOneByteString( STATIC_ASCII_VECTOR("context_extension")); @@ -1249,9 +1243,8 @@ void Genesis::InitializeGlobal(Handle inner_global, Handle code = Handle(isolate->builtins()->builtin( Builtins::kHandleApiCallAsFunction)); - Handle delegate = - factory->NewFunction(factory->empty_string(), JS_OBJECT_TYPE, - JSObject::kHeaderSize, code, true); + Handle delegate = factory->NewFunction( + factory->empty_string(), JS_OBJECT_TYPE, JSObject::kHeaderSize, code); native_context()->set_call_as_function_delegate(*delegate); delegate->shared()->DontAdaptArguments(); } @@ -1261,9 +1254,8 @@ void Genesis::InitializeGlobal(Handle inner_global, Handle code = Handle(isolate->builtins()->builtin( Builtins::kHandleApiCallAsConstructor)); - Handle delegate = - factory->NewFunction(factory->empty_string(), JS_OBJECT_TYPE, - JSObject::kHeaderSize, code, true); + Handle delegate = factory->NewFunction( + factory->empty_string(), JS_OBJECT_TYPE, JSObject::kHeaderSize, code); native_context()->set_call_as_constructor_delegate(*delegate); delegate->shared()->DontAdaptArguments(); } @@ -1627,10 +1619,9 @@ bool Genesis::InstallNatives() { // (itself) and a reference to the native_context directly in the object. Handle code = Handle( isolate()->builtins()->builtin(Builtins::kIllegal)); - Handle builtins_fun = - factory()->NewFunction(factory()->empty_string(), - JS_BUILTINS_OBJECT_TYPE, - JSBuiltinsObject::kSize, code, true); + Handle builtins_fun = factory()->NewFunction( + factory()->empty_string(), JS_BUILTINS_OBJECT_TYPE, + JSBuiltinsObject::kSize, code); Handle name = factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("builtins")); diff --git a/src/factory.cc b/src/factory.cc index 0c79e6c..27c6f6d 100644 --- a/src/factory.cc +++ b/src/factory.cc @@ -1233,12 +1233,11 @@ Handle Factory::NewFunction(MaybeHandle maybe_prototype, Handle name, InstanceType type, int instance_size, - Handle code, - bool force_initial_map) { + Handle code) { // Allocate the function Handle function = NewFunction(name, maybe_prototype, code); - if (force_initial_map || + if (!maybe_prototype.is_null() || type != JS_OBJECT_TYPE || instance_size != JSObject::kHeaderSize) { Handle prototype = maybe_prototype.ToHandleChecked(); @@ -1262,10 +1261,8 @@ Handle Factory::NewFunction(MaybeHandle maybe_prototype, Handle Factory::NewFunction(Handle name, InstanceType type, int instance_size, - Handle code, - bool force_initial_map) { - return NewFunction( - the_hole_value(), name, type, instance_size, code, force_initial_map); + Handle code) { + return NewFunction(the_hole_value(), name, type, instance_size, code); } @@ -2099,8 +2096,7 @@ Handle Factory::CreateApiFunction( if (obj->remove_prototype()) maybe_prototype = MaybeHandle(); Handle result = NewFunction( - maybe_prototype, Factory::empty_string(), type, - instance_size, code, !obj->remove_prototype()); + maybe_prototype, Factory::empty_string(), type, instance_size, code); result->shared()->set_length(obj->length()); Handle class_name(obj->class_name(), isolate()); diff --git a/src/factory.h b/src/factory.h index 87eb61a..52f9271 100644 --- a/src/factory.h +++ b/src/factory.h @@ -465,13 +465,11 @@ class Factory V8_FINAL { Handle name, InstanceType type, int instance_size, - Handle code, - bool force_initial_map); + Handle code); Handle NewFunction(Handle name, InstanceType type, int instance_size, - Handle code, - bool force_initial_map); + Handle code); // Create a serialized scope info. Handle NewScopeInfo(int length); -- 2.7.4