| Index: src/bootstrapper.cc
|
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
|
| index a79300b20698a1962f8d2a0bf99f2f149232be41..53e023283595f0a677c9f640c31ea3c0a56b781b 100644
|
| --- a/src/bootstrapper.cc
|
| +++ b/src/bootstrapper.cc
|
| @@ -538,31 +538,33 @@ void Genesis::SetStrictFunctionInstanceDescriptor(
|
| if (prototypeMode != DONT_ADD_PROTOTYPE) {
|
| prototype = factory()->NewForeign(&Accessors::FunctionPrototype);
|
| }
|
| - PropertyAttributes attribs = static_cast<PropertyAttributes>(
|
| - DONT_ENUM | DONT_DELETE);
|
| + PropertyAttributes rw_attribs =
|
| + static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
|
| + PropertyAttributes ro_attribs =
|
| + static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
|
| map->set_instance_descriptors(*descriptors);
|
|
|
| { // Add length.
|
| - CallbacksDescriptor d(*factory()->length_string(), *length, attribs);
|
| + CallbacksDescriptor d(*factory()->length_string(), *length, ro_attribs);
|
| map->AppendDescriptor(&d, witness);
|
| }
|
| { // Add name.
|
| - CallbacksDescriptor d(*factory()->name_string(), *name, attribs);
|
| + CallbacksDescriptor d(*factory()->name_string(), *name, rw_attribs);
|
| map->AppendDescriptor(&d, witness);
|
| }
|
| { // Add arguments.
|
| - CallbacksDescriptor d(*factory()->arguments_string(), *arguments, attribs);
|
| + CallbacksDescriptor d(*factory()->arguments_string(), *arguments,
|
| + rw_attribs);
|
| map->AppendDescriptor(&d, witness);
|
| }
|
| { // Add caller.
|
| - CallbacksDescriptor d(*factory()->caller_string(), *caller, attribs);
|
| + CallbacksDescriptor d(*factory()->caller_string(), *caller, rw_attribs);
|
| map->AppendDescriptor(&d, witness);
|
| }
|
| if (prototypeMode != DONT_ADD_PROTOTYPE) {
|
| // Add prototype.
|
| - if (prototypeMode != ADD_WRITEABLE_PROTOTYPE) {
|
| - attribs = static_cast<PropertyAttributes>(attribs | READ_ONLY);
|
| - }
|
| + PropertyAttributes attribs =
|
| + prototypeMode == ADD_WRITEABLE_PROTOTYPE ? rw_attribs : ro_attribs;
|
| CallbacksDescriptor d(*factory()->prototype_string(), *prototype, attribs);
|
| map->AppendDescriptor(&d, witness);
|
| }
|
| @@ -857,6 +859,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
|
| isolate->initial_object_prototype(),
|
| Builtins::kArrayCode, true, true);
|
| array_function->shared()->DontAdaptArguments();
|
| + array_function->shared()->set_function_data(Smi::FromInt(kArrayCode));
|
|
|
| // This seems a bit hackish, but we need to make sure Array.length
|
| // is 1.
|
| @@ -2499,8 +2502,9 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
|
| Handle<Name> key = Handle<Name>(Name::cast(raw_key));
|
| Handle<Object> value = Handle<Object>(properties->ValueAt(i),
|
| isolate());
|
| - if (value->IsJSGlobalPropertyCell()) {
|
| - value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value(),
|
| + ASSERT(!value->IsCell());
|
| + if (value->IsPropertyCell()) {
|
| + value = Handle<Object>(PropertyCell::cast(*value)->value(),
|
| isolate());
|
| }
|
| PropertyDetails details = properties->DetailsAt(i);
|
|
|