Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index b6084c080389d7958c3f046e0a3b14b9e23c3613..2e717fbd40f8292df3d25f7b5605d3f09d3e224d 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -355,14 +355,14 @@ static Handle<JSFunction> InstallFunction(Handle<JSObject> target, |
Factory* factory = isolate->factory(); |
Handle<String> internalized_name = factory->InternalizeUtf8String(name); |
Handle<Code> call_code = Handle<Code>(isolate->builtins()->builtin(call)); |
- Handle<JSFunction> function = prototype.is_null() ? |
- factory->NewFunctionWithoutPrototype(internalized_name, call_code) : |
- factory->NewFunctionWithPrototype(internalized_name, |
- type, |
- instance_size, |
- prototype, |
- call_code, |
- install_initial_map); |
+ Handle<JSFunction> function = prototype.is_null() |
+ ? factory->NewFunction(internalized_name, call_code) |
+ : factory->NewFunctionWithPrototype(internalized_name, |
+ type, |
+ instance_size, |
+ prototype, |
+ call_code, |
+ install_initial_map); |
PropertyAttributes attributes; |
if (target->IsJSBuiltinsObject()) { |
attributes = |
@@ -458,8 +458,8 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) { |
Handle<String> object_name = factory->Object_string(); |
{ // --- O b j e c t --- |
- Handle<JSFunction> object_fun = |
- factory->NewFunction(object_name, factory->null_value()); |
+ Handle<JSFunction> object_fun = factory->NewFunctionWithPrototype( |
+ object_name, factory->null_value()); |
Handle<Map> object_function_map = |
factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
object_fun->set_initial_map(*object_function_map); |
@@ -486,8 +486,7 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) { |
factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("Empty")); |
Handle<Code> code = |
Handle<Code>(isolate->builtins()->builtin(Builtins::kEmptyFunction)); |
- Handle<JSFunction> empty_function = |
- factory->NewFunctionWithoutPrototype(empty_string, code); |
+ Handle<JSFunction> empty_function = factory->NewFunction(empty_string, code); |
// --- E m p t y --- |
Handle<String> source = |
@@ -566,8 +565,7 @@ Handle<JSFunction> Genesis::GetThrowTypeErrorFunction() { |
STATIC_ASCII_VECTOR("ThrowTypeError")); |
Handle<Code> code(isolate()->builtins()->builtin( |
Builtins::kStrictModePoisonPill)); |
- throw_type_error_function = |
- factory()->NewFunctionWithoutPrototype(name, code); |
+ throw_type_error_function = factory()->NewFunction(name, code); |
throw_type_error_function->set_map(native_context()->sloppy_function_map()); |
throw_type_error_function->shared()->DontAdaptArguments(); |
@@ -1018,8 +1016,8 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
{ // -- J S O N |
Handle<String> name = factory->InternalizeUtf8String("JSON"); |
- Handle<JSFunction> cons = factory->NewFunction(name, |
- factory->the_hole_value()); |
+ Handle<JSFunction> cons = factory->NewFunctionWithPrototype( |
+ name, factory->the_hole_value()); |
JSFunction::SetInstancePrototype(cons, |
Handle<Object>(native_context()->initial_object_prototype(), isolate)); |
cons->SetInstanceClassName(*name); |
@@ -1065,11 +1063,9 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
// class_name equals 'Arguments'. |
Handle<String> arguments_string = factory->InternalizeOneByteString( |
STATIC_ASCII_VECTOR("Arguments")); |
- Handle<Code> code = Handle<Code>( |
- isolate->builtins()->builtin(Builtins::kIllegal)); |
- Handle<JSObject> prototype = |
- Handle<JSObject>( |
- JSObject::cast(native_context()->object_function()->prototype())); |
+ Handle<Code> code(isolate->builtins()->builtin(Builtins::kIllegal)); |
+ Handle<JSObject> prototype( |
+ JSObject::cast(native_context()->object_function()->prototype())); |
Handle<JSFunction> function = |
factory->NewFunctionWithPrototype(arguments_string, |
@@ -1651,9 +1647,8 @@ bool Genesis::InstallNatives() { |
set_builtins(*builtins); |
// Create a bridge function that has context in the native context. |
- Handle<JSFunction> bridge = |
- factory()->NewFunction(factory()->empty_string(), |
- factory()->undefined_value()); |
+ Handle<JSFunction> bridge = factory()->NewFunctionWithPrototype( |
+ factory()->empty_string(), factory()->undefined_value()); |
ASSERT(bridge->context() == *isolate()->native_context()); |
// Allocate the builtins context. |