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

Unified Diff: src/bootstrapper.cc

Issue 352813002: Wrap InitializeProperty around SetOwnPropertyIgnoreAttributes and switch over uses (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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.cc » ('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 8909e25f638032df8dba94649c659c6c9afc8331..b94115c7c593e20a04d034efce6d145502d7e8ba 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -379,8 +379,7 @@ static Handle<JSFunction> InstallFunction(Handle<JSObject> target,
} else {
attributes = DONT_ENUM;
}
- JSObject::SetOwnPropertyIgnoreAttributes(
- target, internalized_name, function, attributes).Check();
+ JSObject::AddProperty(target, internalized_name, function, attributes);
if (target->IsJSGlobalObject()) {
function->shared()->set_instance_class_name(*internalized_name);
}
@@ -889,9 +888,8 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
Heap* heap = isolate->heap();
Handle<String> object_name = factory->Object_string();
- JSObject::SetOwnPropertyIgnoreAttributes(
- inner_global, object_name,
- isolate->object_function(), DONT_ENUM).Check();
+ JSObject::AddProperty(
+ inner_global, object_name, isolate->object_function(), DONT_ENUM);
Handle<JSObject> global(native_context()->global_object());
@@ -1090,8 +1088,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
cons->SetInstanceClassName(*name);
Handle<JSObject> json_object = factory->NewJSObject(cons, TENURED);
ASSERT(json_object->IsJSObject());
- JSObject::SetOwnPropertyIgnoreAttributes(
- global, name, json_object, DONT_ENUM).Check();
+ JSObject::AddProperty(global, name, json_object, DONT_ENUM);
native_context()->set_json_object(*json_object);
}
@@ -1156,14 +1153,14 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
native_context()->set_sloppy_arguments_boilerplate(*result);
// Note: length must be added as the first property and
// callee must be added as the second property.
- JSObject::SetOwnPropertyIgnoreAttributes(
+ JSObject::AddProperty(
result, factory->length_string(),
factory->undefined_value(), DONT_ENUM,
- Object::FORCE_TAGGED, FORCE_FIELD).Check();
- JSObject::SetOwnPropertyIgnoreAttributes(
+ Object::FORCE_TAGGED, FORCE_FIELD);
+ JSObject::AddProperty(
result, factory->callee_string(),
factory->undefined_value(), DONT_ENUM,
- Object::FORCE_TAGGED, FORCE_FIELD).Check();
+ Object::FORCE_TAGGED, FORCE_FIELD);
#ifdef DEBUG
LookupResult lookup(isolate);
@@ -1262,11 +1259,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
Handle<JSObject> result = factory->NewJSObjectFromMap(map);
native_context()->set_strict_arguments_boilerplate(*result);
- // Add length property only for strict mode boilerplate.
- JSObject::SetOwnPropertyIgnoreAttributes(
- result, factory->length_string(),
- factory->undefined_value(), DONT_ENUM).Check();
-
#ifdef DEBUG
LookupResult lookup(isolate);
result->LookupOwn(factory->length_string(), &lookup);
@@ -1274,6 +1266,10 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
ASSERT(lookup.GetFieldIndex().property_index() ==
Heap::kArgumentsLengthIndex);
+ Handle<Object> length_value = Object::GetProperty(
+ result, factory->length_string()).ToHandleChecked();
+ ASSERT_EQ(heap->undefined_value(), *length_value);
+
ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex);
// Check the state of the object.
@@ -1736,12 +1732,10 @@ bool Genesis::InstallNatives() {
Handle<String> global_string =
factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("global"));
Handle<Object> global_obj(native_context()->global_object(), isolate());
- JSObject::SetOwnPropertyIgnoreAttributes(
- builtins, global_string, global_obj, attributes).Check();
+ JSObject::AddProperty(builtins, global_string, global_obj, attributes);
Handle<String> builtins_string =
factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("builtins"));
- JSObject::SetOwnPropertyIgnoreAttributes(
- builtins, builtins_string, builtins, attributes).Check();
+ JSObject::AddProperty(builtins, builtins_string, builtins, attributes);
// Set up the reference from the global object to the builtins object.
JSGlobalObject::cast(native_context()->global_object())->
@@ -2454,16 +2448,14 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
ASSERT(!descs->GetDetails(i).representation().IsDouble());
Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index),
isolate());
- JSObject::SetOwnPropertyIgnoreAttributes(
- to, key, value, details.attributes()).Check();
+ JSObject::AddProperty(to, key, value, details.attributes());
break;
}
case CONSTANT: {
HandleScope inner(isolate());
Handle<Name> key = Handle<Name>(descs->GetKey(i));
Handle<Object> constant(descs->GetConstant(i), isolate());
- JSObject::SetOwnPropertyIgnoreAttributes(
- to, key, constant, details.attributes()).Check();
+ JSObject::AddProperty(to, key, constant, details.attributes());
break;
}
case CALLBACKS: {
@@ -2513,8 +2505,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
isolate());
}
PropertyDetails details = properties->DetailsAt(i);
- JSObject::SetOwnPropertyIgnoreAttributes(
- to, key, value, details.attributes()).Check();
+ JSObject::AddProperty(to, key, value, details.attributes());
}
}
}
« no previous file with comments | « no previous file | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698