|
@ -264,13 +264,13 @@ class Genesis BASE_EMBEDDED { |
|
|
Handle<Map> CreateStrictModeFunctionMap( |
|
|
Handle<Map> CreateStrictModeFunctionMap( |
|
|
PrototypePropertyMode prototype_mode, |
|
|
PrototypePropertyMode prototype_mode, |
|
|
Handle<JSFunction> empty_function, |
|
|
Handle<JSFunction> empty_function, |
|
|
Handle<FixedArray> arguments_callbacks, |
|
|
Handle<AccessorPair> arguments_callbacks, |
|
|
Handle<FixedArray> caller_callbacks); |
|
|
Handle<AccessorPair> caller_callbacks); |
|
|
|
|
|
|
|
|
Handle<DescriptorArray> ComputeStrictFunctionInstanceDescriptor( |
|
|
Handle<DescriptorArray> ComputeStrictFunctionInstanceDescriptor( |
|
|
PrototypePropertyMode propertyMode, |
|
|
PrototypePropertyMode propertyMode, |
|
|
Handle<FixedArray> arguments, |
|
|
Handle<AccessorPair> arguments, |
|
|
Handle<FixedArray> caller); |
|
|
Handle<AccessorPair> caller); |
|
|
|
|
|
|
|
|
static bool CompileBuiltin(Isolate* isolate, int index); |
|
|
static bool CompileBuiltin(Isolate* isolate, int index); |
|
|
static bool CompileExperimentalBuiltin(Isolate* isolate, int index); |
|
|
static bool CompileExperimentalBuiltin(Isolate* isolate, int index); |
|
@ -378,7 +378,9 @@ static Handle<JSFunction> InstallFunction(Handle<JSObject> target, |
|
|
} else { |
|
|
} else { |
|
|
attributes = DONT_ENUM; |
|
|
attributes = DONT_ENUM; |
|
|
} |
|
|
} |
|
|
SetLocalPropertyNoThrow(target, symbol, function, attributes); |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
|
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
target, symbol, function, attributes)); |
|
|
if (is_ecma_native) { |
|
|
if (is_ecma_native) { |
|
|
function->shared()->set_instance_class_name(*symbol); |
|
|
function->shared()->set_instance_class_name(*symbol); |
|
|
} |
|
|
} |
|
@ -538,8 +540,8 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) { |
|
|
|
|
|
|
|
|
Handle<DescriptorArray> Genesis::ComputeStrictFunctionInstanceDescriptor( |
|
|
Handle<DescriptorArray> Genesis::ComputeStrictFunctionInstanceDescriptor( |
|
|
PrototypePropertyMode prototypeMode, |
|
|
PrototypePropertyMode prototypeMode, |
|
|
Handle<FixedArray> arguments, |
|
|
Handle<AccessorPair> arguments, |
|
|
Handle<FixedArray> caller) { |
|
|
Handle<AccessorPair> caller) { |
|
|
Handle<DescriptorArray> descriptors = |
|
|
Handle<DescriptorArray> descriptors = |
|
|
factory()->NewDescriptorArray(prototypeMode == DONT_ADD_PROTOTYPE |
|
|
factory()->NewDescriptorArray(prototypeMode == DONT_ADD_PROTOTYPE |
|
|
? 4 |
|
|
? 4 |
|
@ -600,7 +602,7 @@ Handle<JSFunction> Genesis::GetThrowTypeErrorFunction() { |
|
|
throw_type_error_function->shared()->set_code(*code); |
|
|
throw_type_error_function->shared()->set_code(*code); |
|
|
throw_type_error_function->shared()->DontAdaptArguments(); |
|
|
throw_type_error_function->shared()->DontAdaptArguments(); |
|
|
|
|
|
|
|
|
PreventExtensions(throw_type_error_function); |
|
|
JSObject::PreventExtensions(throw_type_error_function); |
|
|
} |
|
|
} |
|
|
return throw_type_error_function; |
|
|
return throw_type_error_function; |
|
|
} |
|
|
} |
|
@ -609,8 +611,8 @@ Handle<JSFunction> Genesis::GetThrowTypeErrorFunction() { |
|
|
Handle<Map> Genesis::CreateStrictModeFunctionMap( |
|
|
Handle<Map> Genesis::CreateStrictModeFunctionMap( |
|
|
PrototypePropertyMode prototype_mode, |
|
|
PrototypePropertyMode prototype_mode, |
|
|
Handle<JSFunction> empty_function, |
|
|
Handle<JSFunction> empty_function, |
|
|
Handle<FixedArray> arguments_callbacks, |
|
|
Handle<AccessorPair> arguments_callbacks, |
|
|
Handle<FixedArray> caller_callbacks) { |
|
|
Handle<AccessorPair> caller_callbacks) { |
|
|
Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); |
|
|
Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); |
|
|
Handle<DescriptorArray> descriptors = |
|
|
Handle<DescriptorArray> descriptors = |
|
|
ComputeStrictFunctionInstanceDescriptor(prototype_mode, |
|
|
ComputeStrictFunctionInstanceDescriptor(prototype_mode, |
|
@ -627,8 +629,8 @@ void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) { |
|
|
// Create the callbacks arrays for ThrowTypeError functions.
|
|
|
// Create the callbacks arrays for ThrowTypeError functions.
|
|
|
// The get/set callacks are filled in after the maps are created below.
|
|
|
// The get/set callacks are filled in after the maps are created below.
|
|
|
Factory* factory = empty->GetIsolate()->factory(); |
|
|
Factory* factory = empty->GetIsolate()->factory(); |
|
|
Handle<FixedArray> arguments = factory->NewFixedArray(2, TENURED); |
|
|
Handle<AccessorPair> arguments(factory->NewAccessorPair()); |
|
|
Handle<FixedArray> caller = factory->NewFixedArray(2, TENURED); |
|
|
Handle<AccessorPair> caller(factory->NewAccessorPair()); |
|
|
|
|
|
|
|
|
// Allocate map for the strict mode function instances.
|
|
|
// Allocate map for the strict mode function instances.
|
|
|
Handle<Map> strict_mode_function_instance_map = |
|
|
Handle<Map> strict_mode_function_instance_map = |
|
@ -663,11 +665,11 @@ void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) { |
|
|
Handle<JSFunction> throw_function = |
|
|
Handle<JSFunction> throw_function = |
|
|
GetThrowTypeErrorFunction(); |
|
|
GetThrowTypeErrorFunction(); |
|
|
|
|
|
|
|
|
// Complete the callback fixed arrays.
|
|
|
// Complete the callbacks.
|
|
|
arguments->set(0, *throw_function); |
|
|
arguments->set_getter(*throw_function); |
|
|
arguments->set(1, *throw_function); |
|
|
arguments->set_setter(*throw_function); |
|
|
caller->set(0, *throw_function); |
|
|
caller->set_getter(*throw_function); |
|
|
caller->set(1, *throw_function); |
|
|
caller->set_setter(*throw_function); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -753,11 +755,10 @@ Handle<JSGlobalProxy> Genesis::CreateNewGlobals( |
|
|
Handle<JSObject> prototype = |
|
|
Handle<JSObject> prototype = |
|
|
Handle<JSObject>( |
|
|
Handle<JSObject>( |
|
|
JSObject::cast(js_global_function->instance_prototype())); |
|
|
JSObject::cast(js_global_function->instance_prototype())); |
|
|
SetLocalPropertyNoThrow( |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate(), |
|
|
prototype, |
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
factory()->constructor_symbol(), |
|
|
prototype, factory()->constructor_symbol(), |
|
|
isolate()->object_function(), |
|
|
isolate()->object_function(), NONE)); |
|
|
NONE); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
Handle<FunctionTemplateInfo> js_global_constructor( |
|
|
Handle<FunctionTemplateInfo> js_global_constructor( |
|
|
FunctionTemplateInfo::cast(js_global_template->constructor())); |
|
|
FunctionTemplateInfo::cast(js_global_template->constructor())); |
|
@ -834,7 +835,7 @@ void Genesis::HookUpInnerGlobal(Handle<GlobalObject> inner_global) { |
|
|
factory()->LookupAsciiSymbol("global"), |
|
|
factory()->LookupAsciiSymbol("global"), |
|
|
inner_global, |
|
|
inner_global, |
|
|
attributes); |
|
|
attributes); |
|
|
// Setup the reference from the global object to the builtins object.
|
|
|
// Set up the reference from the global object to the builtins object.
|
|
|
JSGlobalObject::cast(*inner_global)->set_builtins(*builtins_global); |
|
|
JSGlobalObject::cast(*inner_global)->set_builtins(*builtins_global); |
|
|
TransferNamedProperties(inner_global_from_snapshot, inner_global); |
|
|
TransferNamedProperties(inner_global_from_snapshot, inner_global); |
|
|
TransferIndexedProperties(inner_global_from_snapshot, inner_global); |
|
|
TransferIndexedProperties(inner_global_from_snapshot, inner_global); |
|
@ -863,8 +864,10 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
|
|
Heap* heap = isolate->heap(); |
|
|
Heap* heap = isolate->heap(); |
|
|
|
|
|
|
|
|
Handle<String> object_name = Handle<String>(heap->Object_symbol()); |
|
|
Handle<String> object_name = Handle<String>(heap->Object_symbol()); |
|
|
SetLocalPropertyNoThrow(inner_global, object_name, |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
isolate->object_function(), DONT_ENUM); |
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
inner_global, object_name, |
|
|
|
|
|
isolate->object_function(), DONT_ENUM)); |
|
|
|
|
|
|
|
|
Handle<JSObject> global = Handle<JSObject>(global_context()->global()); |
|
|
Handle<JSObject> global = Handle<JSObject>(global_context()->global()); |
|
|
|
|
|
|
|
@ -1046,14 +1049,15 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
|
|
|
|
|
|
|
|
{ // -- J S O N
|
|
|
{ // -- J S O N
|
|
|
Handle<String> name = factory->NewStringFromAscii(CStrVector("JSON")); |
|
|
Handle<String> name = factory->NewStringFromAscii(CStrVector("JSON")); |
|
|
Handle<JSFunction> cons = factory->NewFunction( |
|
|
Handle<JSFunction> cons = factory->NewFunction(name, |
|
|
name, |
|
|
|
|
|
factory->the_hole_value()); |
|
|
factory->the_hole_value()); |
|
|
cons->SetInstancePrototype(global_context()->initial_object_prototype()); |
|
|
cons->SetInstancePrototype(global_context()->initial_object_prototype()); |
|
|
cons->SetInstanceClassName(*name); |
|
|
cons->SetInstanceClassName(*name); |
|
|
Handle<JSObject> json_object = factory->NewJSObject(cons, TENURED); |
|
|
Handle<JSObject> json_object = factory->NewJSObject(cons, TENURED); |
|
|
ASSERT(json_object->IsJSObject()); |
|
|
ASSERT(json_object->IsJSObject()); |
|
|
SetLocalPropertyNoThrow(global, name, json_object, DONT_ENUM); |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
|
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
global, name, json_object, DONT_ENUM)); |
|
|
global_context()->set_json_object(*json_object); |
|
|
global_context()->set_json_object(*json_object); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1083,12 +1087,14 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
|
|
global_context()->set_arguments_boilerplate(*result); |
|
|
global_context()->set_arguments_boilerplate(*result); |
|
|
// Note: length must be added as the first property and
|
|
|
// Note: length must be added as the first property and
|
|
|
// callee must be added as the second property.
|
|
|
// callee must be added as the second property.
|
|
|
SetLocalPropertyNoThrow(result, factory->length_symbol(), |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
factory->undefined_value(), |
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
DONT_ENUM); |
|
|
result, factory->length_symbol(), |
|
|
SetLocalPropertyNoThrow(result, factory->callee_symbol(), |
|
|
factory->undefined_value(), DONT_ENUM)); |
|
|
factory->undefined_value(), |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
DONT_ENUM); |
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
result, factory->callee_symbol(), |
|
|
|
|
|
factory->undefined_value(), DONT_ENUM)); |
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
#ifdef DEBUG |
|
|
LookupResult lookup(isolate); |
|
|
LookupResult lookup(isolate); |
|
@ -1136,17 +1142,17 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
|
|
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
|
|
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
|
|
|
|
|
|
|
|
// Create the ThrowTypeError functions.
|
|
|
// Create the ThrowTypeError functions.
|
|
|
Handle<FixedArray> callee = factory->NewFixedArray(2, TENURED); |
|
|
Handle<AccessorPair> callee = factory->NewAccessorPair(); |
|
|
Handle<FixedArray> caller = factory->NewFixedArray(2, TENURED); |
|
|
Handle<AccessorPair> caller = factory->NewAccessorPair(); |
|
|
|
|
|
|
|
|
Handle<JSFunction> throw_function = |
|
|
Handle<JSFunction> throw_function = |
|
|
GetThrowTypeErrorFunction(); |
|
|
GetThrowTypeErrorFunction(); |
|
|
|
|
|
|
|
|
// Install the ThrowTypeError functions.
|
|
|
// Install the ThrowTypeError functions.
|
|
|
callee->set(0, *throw_function); |
|
|
callee->set_getter(*throw_function); |
|
|
callee->set(1, *throw_function); |
|
|
callee->set_setter(*throw_function); |
|
|
caller->set(0, *throw_function); |
|
|
caller->set_getter(*throw_function); |
|
|
caller->set(1, *throw_function); |
|
|
caller->set_setter(*throw_function); |
|
|
|
|
|
|
|
|
// Create the descriptor array for the arguments object.
|
|
|
// Create the descriptor array for the arguments object.
|
|
|
Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(3); |
|
|
Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(3); |
|
@ -1183,9 +1189,10 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
|
|
global_context()->set_strict_mode_arguments_boilerplate(*result); |
|
|
global_context()->set_strict_mode_arguments_boilerplate(*result); |
|
|
|
|
|
|
|
|
// Add length property only for strict mode boilerplate.
|
|
|
// Add length property only for strict mode boilerplate.
|
|
|
SetLocalPropertyNoThrow(result, factory->length_symbol(), |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
factory->undefined_value(), |
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
DONT_ENUM); |
|
|
result, factory->length_symbol(), |
|
|
|
|
|
factory->undefined_value(), DONT_ENUM)); |
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
#ifdef DEBUG |
|
|
LookupResult lookup(isolate); |
|
|
LookupResult lookup(isolate); |
|
@ -1353,7 +1360,7 @@ bool Genesis::CompileScriptCached(Vector<const char> name, |
|
|
if (cache != NULL) cache->Add(name, function_info); |
|
|
if (cache != NULL) cache->Add(name, function_info); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Setup the function context. Conceptually, we should clone the
|
|
|
// Set up the function context. Conceptually, we should clone the
|
|
|
// function before overwriting the context but since we're in a
|
|
|
// function before overwriting the context but since we're in a
|
|
|
// single-threaded environment it is not strictly necessary.
|
|
|
// single-threaded environment it is not strictly necessary.
|
|
|
ASSERT(top_context->IsGlobalContext()); |
|
|
ASSERT(top_context->IsGlobalContext()); |
|
@ -1440,7 +1447,7 @@ bool Genesis::InstallNatives() { |
|
|
builtins->set_global_context(*global_context()); |
|
|
builtins->set_global_context(*global_context()); |
|
|
builtins->set_global_receiver(*builtins); |
|
|
builtins->set_global_receiver(*builtins); |
|
|
|
|
|
|
|
|
// Setup the 'global' properties of the builtins object. The
|
|
|
// Set up the 'global' properties of the builtins object. The
|
|
|
// 'global' property that refers to the global object is the only
|
|
|
// 'global' property that refers to the global object is the only
|
|
|
// way to get from code running in the builtins context to the
|
|
|
// way to get from code running in the builtins context to the
|
|
|
// global object.
|
|
|
// global object.
|
|
@ -1448,9 +1455,11 @@ bool Genesis::InstallNatives() { |
|
|
static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
|
|
static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
|
|
Handle<String> global_symbol = factory()->LookupAsciiSymbol("global"); |
|
|
Handle<String> global_symbol = factory()->LookupAsciiSymbol("global"); |
|
|
Handle<Object> global_obj(global_context()->global()); |
|
|
Handle<Object> global_obj(global_context()->global()); |
|
|
SetLocalPropertyNoThrow(builtins, global_symbol, global_obj, attributes); |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate(), |
|
|
|
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
builtins, global_symbol, global_obj, attributes)); |
|
|
|
|
|
|
|
|
// Setup the reference from the global object to the builtins object.
|
|
|
// Set up the reference from the global object to the builtins object.
|
|
|
JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins); |
|
|
JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins); |
|
|
|
|
|
|
|
|
// Create a bridge function that has context in the global context.
|
|
|
// Create a bridge function that has context in the global context.
|
|
@ -1674,7 +1683,7 @@ bool Genesis::InstallNatives() { |
|
|
InstallNativeFunctions(); |
|
|
InstallNativeFunctions(); |
|
|
|
|
|
|
|
|
// Store the map for the string prototype after the natives has been compiled
|
|
|
// Store the map for the string prototype after the natives has been compiled
|
|
|
// and the String function has been setup.
|
|
|
// and the String function has been set up.
|
|
|
Handle<JSFunction> string_function(global_context()->string_function()); |
|
|
Handle<JSFunction> string_function(global_context()->string_function()); |
|
|
ASSERT(JSObject::cast( |
|
|
ASSERT(JSObject::cast( |
|
|
string_function->initial_map()->prototype())->HasFastProperties()); |
|
|
string_function->initial_map()->prototype())->HasFastProperties()); |
|
@ -1911,25 +1920,28 @@ bool Bootstrapper::InstallExtensions(Handle<Context> global_context, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Genesis::InstallSpecialObjects(Handle<Context> global_context) { |
|
|
void Genesis::InstallSpecialObjects(Handle<Context> global_context) { |
|
|
Factory* factory = global_context->GetIsolate()->factory(); |
|
|
Isolate* isolate = global_context->GetIsolate(); |
|
|
|
|
|
Factory* factory = isolate->factory(); |
|
|
HandleScope scope; |
|
|
HandleScope scope; |
|
|
Handle<JSGlobalObject> js_global( |
|
|
Handle<JSGlobalObject> global(JSGlobalObject::cast(global_context->global())); |
|
|
JSGlobalObject::cast(global_context->global())); |
|
|
|
|
|
// Expose the natives in global if a name for it is specified.
|
|
|
// Expose the natives in global if a name for it is specified.
|
|
|
if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) { |
|
|
if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) { |
|
|
Handle<String> natives_string = |
|
|
Handle<String> natives = factory->LookupAsciiSymbol(FLAG_expose_natives_as); |
|
|
factory->LookupAsciiSymbol(FLAG_expose_natives_as); |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
SetLocalPropertyNoThrow(js_global, natives_string, |
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
Handle<JSObject>(js_global->builtins()), DONT_ENUM); |
|
|
global, natives, |
|
|
|
|
|
Handle<JSObject>(global->builtins()), |
|
|
|
|
|
DONT_ENUM)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Handle<Object> Error = GetProperty(js_global, "Error"); |
|
|
Handle<Object> Error = GetProperty(global, "Error"); |
|
|
if (Error->IsJSObject()) { |
|
|
if (Error->IsJSObject()) { |
|
|
Handle<String> name = factory->LookupAsciiSymbol("stackTraceLimit"); |
|
|
Handle<String> name = factory->LookupAsciiSymbol("stackTraceLimit"); |
|
|
SetLocalPropertyNoThrow(Handle<JSObject>::cast(Error), |
|
|
Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit)); |
|
|
name, |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
Handle<Smi>(Smi::FromInt(FLAG_stack_trace_limit)), |
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
NONE); |
|
|
Handle<JSObject>::cast(Error), name, |
|
|
|
|
|
stack_trace_limit, NONE)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#ifdef ENABLE_DEBUGGER_SUPPORT |
|
|
#ifdef ENABLE_DEBUGGER_SUPPORT |
|
@ -1948,7 +1960,9 @@ void Genesis::InstallSpecialObjects(Handle<Context> global_context) { |
|
|
Handle<String> debug_string = |
|
|
Handle<String> debug_string = |
|
|
factory->LookupAsciiSymbol(FLAG_expose_debug_as); |
|
|
factory->LookupAsciiSymbol(FLAG_expose_debug_as); |
|
|
Handle<Object> global_proxy(debug->debug_context()->global_proxy()); |
|
|
Handle<Object> global_proxy(debug->debug_context()->global_proxy()); |
|
|
SetLocalPropertyNoThrow(js_global, debug_string, global_proxy, DONT_ENUM); |
|
|
CHECK_NOT_EMPTY_HANDLE(isolate, |
|
|
|
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
global, debug_string, global_proxy, DONT_ENUM)); |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
@ -2164,7 +2178,9 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from, |
|
|
Handle<String> key = Handle<String>(descs->GetKey(i)); |
|
|
Handle<String> key = Handle<String>(descs->GetKey(i)); |
|
|
int index = descs->GetFieldIndex(i); |
|
|
int index = descs->GetFieldIndex(i); |
|
|
Handle<Object> value = Handle<Object>(from->FastPropertyAt(index)); |
|
|
Handle<Object> value = Handle<Object>(from->FastPropertyAt(index)); |
|
|
SetLocalPropertyNoThrow(to, key, value, details.attributes()); |
|
|
CHECK_NOT_EMPTY_HANDLE(to->GetIsolate(), |
|
|
|
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
to, key, value, details.attributes())); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
case CONSTANT_FUNCTION: { |
|
|
case CONSTANT_FUNCTION: { |
|
@ -2172,7 +2188,9 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from, |
|
|
Handle<String> key = Handle<String>(descs->GetKey(i)); |
|
|
Handle<String> key = Handle<String>(descs->GetKey(i)); |
|
|
Handle<JSFunction> fun = |
|
|
Handle<JSFunction> fun = |
|
|
Handle<JSFunction>(descs->GetConstantFunction(i)); |
|
|
Handle<JSFunction>(descs->GetConstantFunction(i)); |
|
|
SetLocalPropertyNoThrow(to, key, fun, details.attributes()); |
|
|
CHECK_NOT_EMPTY_HANDLE(to->GetIsolate(), |
|
|
|
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
to, key, fun, details.attributes())); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
case CALLBACKS: { |
|
|
case CALLBACKS: { |
|
@ -2187,7 +2205,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from, |
|
|
Handle<Object> callbacks(descs->GetCallbacksObject(i)); |
|
|
Handle<Object> callbacks(descs->GetCallbacksObject(i)); |
|
|
PropertyDetails d = |
|
|
PropertyDetails d = |
|
|
PropertyDetails(details.attributes(), CALLBACKS, details.index()); |
|
|
PropertyDetails(details.attributes(), CALLBACKS, details.index()); |
|
|
SetNormalizedProperty(to, key, callbacks, d); |
|
|
JSObject::SetNormalizedProperty(to, key, callbacks, d); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
case MAP_TRANSITION: |
|
|
case MAP_TRANSITION: |
|
@ -2224,7 +2242,9 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from, |
|
|
value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value()); |
|
|
value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value()); |
|
|
} |
|
|
} |
|
|
PropertyDetails details = properties->DetailsAt(i); |
|
|
PropertyDetails details = properties->DetailsAt(i); |
|
|
SetLocalPropertyNoThrow(to, key, value, details.attributes()); |
|
|
CHECK_NOT_EMPTY_HANDLE(to->GetIsolate(), |
|
|
|
|
|
JSObject::SetLocalPropertyIgnoreAttributes( |
|
|
|
|
|
to, key, value, details.attributes())); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|