Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: src/bootstrapper.cc

Issue 238773009: Set code on the SharedFunctionInfo before creating the function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698