| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 Handle<String> symbol = Factory::LookupAsciiSymbol(name); | 342 Handle<String> symbol = Factory::LookupAsciiSymbol(name); |
| 343 Handle<Code> call_code = Handle<Code>(Builtins::builtin(call)); | 343 Handle<Code> call_code = Handle<Code>(Builtins::builtin(call)); |
| 344 Handle<JSFunction> function = prototype.is_null() ? | 344 Handle<JSFunction> function = prototype.is_null() ? |
| 345 Factory::NewFunctionWithoutPrototype(symbol, call_code) : | 345 Factory::NewFunctionWithoutPrototype(symbol, call_code) : |
| 346 Factory::NewFunctionWithPrototype(symbol, | 346 Factory::NewFunctionWithPrototype(symbol, |
| 347 type, | 347 type, |
| 348 instance_size, | 348 instance_size, |
| 349 prototype, | 349 prototype, |
| 350 call_code, | 350 call_code, |
| 351 is_ecma_native); | 351 is_ecma_native); |
| 352 SetProperty(target, symbol, function, DONT_ENUM); | 352 SetLocalPropertyNoThrow(target, symbol, function, DONT_ENUM); |
| 353 if (is_ecma_native) { | 353 if (is_ecma_native) { |
| 354 function->shared()->set_instance_class_name(*symbol); | 354 function->shared()->set_instance_class_name(*symbol); |
| 355 } | 355 } |
| 356 return function; | 356 return function; |
| 357 } | 357 } |
| 358 | 358 |
| 359 | 359 |
| 360 Handle<DescriptorArray> Genesis::ComputeFunctionInstanceDescriptor( | 360 Handle<DescriptorArray> Genesis::ComputeFunctionInstanceDescriptor( |
| 361 PrototypePropertyMode prototypeMode) { | 361 PrototypePropertyMode prototypeMode) { |
| 362 Handle<DescriptorArray> result = Factory::empty_descriptor_array(); | 362 Handle<DescriptorArray> result = Factory::empty_descriptor_array(); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 Handle<String> name = Handle<String>(Heap::empty_symbol()); | 573 Handle<String> name = Handle<String>(Heap::empty_symbol()); |
| 574 Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal)); | 574 Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal)); |
| 575 js_global_function = | 575 js_global_function = |
| 576 Factory::NewFunction(name, JS_GLOBAL_OBJECT_TYPE, | 576 Factory::NewFunction(name, JS_GLOBAL_OBJECT_TYPE, |
| 577 JSGlobalObject::kSize, code, true); | 577 JSGlobalObject::kSize, code, true); |
| 578 // Change the constructor property of the prototype of the | 578 // Change the constructor property of the prototype of the |
| 579 // hidden global function to refer to the Object function. | 579 // hidden global function to refer to the Object function. |
| 580 Handle<JSObject> prototype = | 580 Handle<JSObject> prototype = |
| 581 Handle<JSObject>( | 581 Handle<JSObject>( |
| 582 JSObject::cast(js_global_function->instance_prototype())); | 582 JSObject::cast(js_global_function->instance_prototype())); |
| 583 SetProperty(prototype, Factory::constructor_symbol(), | 583 SetLocalPropertyNoThrow( |
| 584 Top::object_function(), NONE); | 584 prototype, Factory::constructor_symbol(), Top::object_function(), NONE); |
| 585 } else { | 585 } else { |
| 586 Handle<FunctionTemplateInfo> js_global_constructor( | 586 Handle<FunctionTemplateInfo> js_global_constructor( |
| 587 FunctionTemplateInfo::cast(js_global_template->constructor())); | 587 FunctionTemplateInfo::cast(js_global_template->constructor())); |
| 588 js_global_function = | 588 js_global_function = |
| 589 Factory::CreateApiFunction(js_global_constructor, | 589 Factory::CreateApiFunction(js_global_constructor, |
| 590 Factory::InnerGlobalObject); | 590 Factory::InnerGlobalObject); |
| 591 } | 591 } |
| 592 | 592 |
| 593 js_global_function->initial_map()->set_is_hidden_prototype(); | 593 js_global_function->initial_map()->set_is_hidden_prototype(); |
| 594 Handle<GlobalObject> inner_global = | 594 Handle<GlobalObject> inner_global = |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 // Set extension and global object. | 676 // Set extension and global object. |
| 677 global_context()->set_extension(*inner_global); | 677 global_context()->set_extension(*inner_global); |
| 678 global_context()->set_global(*inner_global); | 678 global_context()->set_global(*inner_global); |
| 679 // Security setup: Set the security token of the global object to | 679 // Security setup: Set the security token of the global object to |
| 680 // its the inner global. This makes the security check between two | 680 // its the inner global. This makes the security check between two |
| 681 // different contexts fail by default even in case of global | 681 // different contexts fail by default even in case of global |
| 682 // object reinitialization. | 682 // object reinitialization. |
| 683 global_context()->set_security_token(*inner_global); | 683 global_context()->set_security_token(*inner_global); |
| 684 | 684 |
| 685 Handle<String> object_name = Handle<String>(Heap::Object_symbol()); | 685 Handle<String> object_name = Handle<String>(Heap::Object_symbol()); |
| 686 SetProperty(inner_global, object_name, Top::object_function(), DONT_ENUM); | 686 SetLocalPropertyNoThrow(inner_global, object_name, |
| 687 Top::object_function(), DONT_ENUM); |
| 687 | 688 |
| 688 Handle<JSObject> global = Handle<JSObject>(global_context()->global()); | 689 Handle<JSObject> global = Handle<JSObject>(global_context()->global()); |
| 689 | 690 |
| 690 // Install global Function object | 691 // Install global Function object |
| 691 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, | 692 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, |
| 692 empty_function, Builtins::Illegal, true); // ECMA native. | 693 empty_function, Builtins::Illegal, true); // ECMA native. |
| 693 | 694 |
| 694 { // --- A r r a y --- | 695 { // --- A r r a y --- |
| 695 Handle<JSFunction> array_function = | 696 Handle<JSFunction> array_function = |
| 696 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, | 697 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 | 845 |
| 845 { // -- J S O N | 846 { // -- J S O N |
| 846 Handle<String> name = Factory::NewStringFromAscii(CStrVector("JSON")); | 847 Handle<String> name = Factory::NewStringFromAscii(CStrVector("JSON")); |
| 847 Handle<JSFunction> cons = Factory::NewFunction( | 848 Handle<JSFunction> cons = Factory::NewFunction( |
| 848 name, | 849 name, |
| 849 Factory::the_hole_value()); | 850 Factory::the_hole_value()); |
| 850 cons->SetInstancePrototype(global_context()->initial_object_prototype()); | 851 cons->SetInstancePrototype(global_context()->initial_object_prototype()); |
| 851 cons->SetInstanceClassName(*name); | 852 cons->SetInstanceClassName(*name); |
| 852 Handle<JSObject> json_object = Factory::NewJSObject(cons, TENURED); | 853 Handle<JSObject> json_object = Factory::NewJSObject(cons, TENURED); |
| 853 ASSERT(json_object->IsJSObject()); | 854 ASSERT(json_object->IsJSObject()); |
| 854 SetProperty(global, name, json_object, DONT_ENUM); | 855 SetLocalPropertyNoThrow(global, name, json_object, DONT_ENUM); |
| 855 global_context()->set_json_object(*json_object); | 856 global_context()->set_json_object(*json_object); |
| 856 } | 857 } |
| 857 | 858 |
| 858 { // --- arguments_boilerplate_ | 859 { // --- arguments_boilerplate_ |
| 859 // Make sure we can recognize argument objects at runtime. | 860 // Make sure we can recognize argument objects at runtime. |
| 860 // This is done by introducing an anonymous function with | 861 // This is done by introducing an anonymous function with |
| 861 // class_name equals 'Arguments'. | 862 // class_name equals 'Arguments'. |
| 862 Handle<String> symbol = Factory::LookupAsciiSymbol("Arguments"); | 863 Handle<String> symbol = Factory::LookupAsciiSymbol("Arguments"); |
| 863 Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal)); | 864 Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal)); |
| 864 Handle<JSObject> prototype = | 865 Handle<JSObject> prototype = |
| 865 Handle<JSObject>( | 866 Handle<JSObject>( |
| 866 JSObject::cast(global_context()->object_function()->prototype())); | 867 JSObject::cast(global_context()->object_function()->prototype())); |
| 867 | 868 |
| 868 Handle<JSFunction> function = | 869 Handle<JSFunction> function = |
| 869 Factory::NewFunctionWithPrototype(symbol, | 870 Factory::NewFunctionWithPrototype(symbol, |
| 870 JS_OBJECT_TYPE, | 871 JS_OBJECT_TYPE, |
| 871 JSObject::kHeaderSize, | 872 JSObject::kHeaderSize, |
| 872 prototype, | 873 prototype, |
| 873 code, | 874 code, |
| 874 false); | 875 false); |
| 875 ASSERT(!function->has_initial_map()); | 876 ASSERT(!function->has_initial_map()); |
| 876 function->shared()->set_instance_class_name(*symbol); | 877 function->shared()->set_instance_class_name(*symbol); |
| 877 function->shared()->set_expected_nof_properties(2); | 878 function->shared()->set_expected_nof_properties(2); |
| 878 Handle<JSObject> result = Factory::NewJSObject(function); | 879 Handle<JSObject> result = Factory::NewJSObject(function); |
| 879 | 880 |
| 880 global_context()->set_arguments_boilerplate(*result); | 881 global_context()->set_arguments_boilerplate(*result); |
| 881 // Note: callee must be added as the first property and | 882 // Note: callee must be added as the first property and |
| 882 // length must be added as the second property. | 883 // length must be added as the second property. |
| 883 SetProperty(result, Factory::callee_symbol(), | 884 SetLocalPropertyNoThrow(result, Factory::callee_symbol(), |
| 884 Factory::undefined_value(), | 885 Factory::undefined_value(), |
| 885 DONT_ENUM); | 886 DONT_ENUM); |
| 886 SetProperty(result, Factory::length_symbol(), | 887 SetLocalPropertyNoThrow(result, Factory::length_symbol(), |
| 887 Factory::undefined_value(), | 888 Factory::undefined_value(), |
| 888 DONT_ENUM); | 889 DONT_ENUM); |
| 889 | 890 |
| 890 #ifdef DEBUG | 891 #ifdef DEBUG |
| 891 LookupResult lookup; | 892 LookupResult lookup; |
| 892 result->LocalLookup(Heap::callee_symbol(), &lookup); | 893 result->LocalLookup(Heap::callee_symbol(), &lookup); |
| 893 ASSERT(lookup.IsProperty() && (lookup.type() == FIELD)); | 894 ASSERT(lookup.IsProperty() && (lookup.type() == FIELD)); |
| 894 ASSERT(lookup.GetFieldIndex() == Heap::arguments_callee_index); | 895 ASSERT(lookup.GetFieldIndex() == Heap::arguments_callee_index); |
| 895 | 896 |
| 896 result->LocalLookup(Heap::length_symbol(), &lookup); | 897 result->LocalLookup(Heap::length_symbol(), &lookup); |
| 897 ASSERT(lookup.IsProperty() && (lookup.type() == FIELD)); | 898 ASSERT(lookup.IsProperty() && (lookup.type() == FIELD)); |
| 898 ASSERT(lookup.GetFieldIndex() == Heap::arguments_length_index); | 899 ASSERT(lookup.GetFieldIndex() == Heap::arguments_length_index); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 builtins->set_global_context(*global_context()); | 1079 builtins->set_global_context(*global_context()); |
| 1079 builtins->set_global_receiver(*builtins); | 1080 builtins->set_global_receiver(*builtins); |
| 1080 | 1081 |
| 1081 // Setup the 'global' properties of the builtins object. The | 1082 // Setup the 'global' properties of the builtins object. The |
| 1082 // 'global' property that refers to the global object is the only | 1083 // 'global' property that refers to the global object is the only |
| 1083 // way to get from code running in the builtins context to the | 1084 // way to get from code running in the builtins context to the |
| 1084 // global object. | 1085 // global object. |
| 1085 static const PropertyAttributes attributes = | 1086 static const PropertyAttributes attributes = |
| 1086 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | 1087 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
| 1087 Handle<String> global_symbol = Factory::LookupAsciiSymbol("global"); | 1088 Handle<String> global_symbol = Factory::LookupAsciiSymbol("global"); |
| 1088 SetProperty(builtins, | 1089 Handle<Object> global_obj(global_context()->global()); |
| 1089 global_symbol, | 1090 SetLocalPropertyNoThrow(builtins, global_symbol, global_obj, attributes); |
| 1090 Handle<Object>(global_context()->global()), | |
| 1091 attributes); | |
| 1092 | 1091 |
| 1093 // Setup the reference from the global object to the builtins object. | 1092 // Setup the reference from the global object to the builtins object. |
| 1094 JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins); | 1093 JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins); |
| 1095 | 1094 |
| 1096 // Create a bridge function that has context in the global context. | 1095 // Create a bridge function that has context in the global context. |
| 1097 Handle<JSFunction> bridge = | 1096 Handle<JSFunction> bridge = |
| 1098 Factory::NewFunction(Factory::empty_symbol(), Factory::undefined_value()); | 1097 Factory::NewFunction(Factory::empty_symbol(), Factory::undefined_value()); |
| 1099 ASSERT(bridge->context() == *Top::global_context()); | 1098 ASSERT(bridge->context() == *Top::global_context()); |
| 1100 | 1099 |
| 1101 // Allocate the builtins context. | 1100 // Allocate the builtins context. |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 | 1472 |
| 1474 | 1473 |
| 1475 void Genesis::InstallSpecialObjects(Handle<Context> global_context) { | 1474 void Genesis::InstallSpecialObjects(Handle<Context> global_context) { |
| 1476 HandleScope scope; | 1475 HandleScope scope; |
| 1477 Handle<JSGlobalObject> js_global( | 1476 Handle<JSGlobalObject> js_global( |
| 1478 JSGlobalObject::cast(global_context->global())); | 1477 JSGlobalObject::cast(global_context->global())); |
| 1479 // Expose the natives in global if a name for it is specified. | 1478 // Expose the natives in global if a name for it is specified. |
| 1480 if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) { | 1479 if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) { |
| 1481 Handle<String> natives_string = | 1480 Handle<String> natives_string = |
| 1482 Factory::LookupAsciiSymbol(FLAG_expose_natives_as); | 1481 Factory::LookupAsciiSymbol(FLAG_expose_natives_as); |
| 1483 SetProperty(js_global, natives_string, | 1482 SetLocalPropertyNoThrow(js_global, natives_string, |
| 1484 Handle<JSObject>(js_global->builtins()), DONT_ENUM); | 1483 Handle<JSObject>(js_global->builtins()), DONT_ENUM); |
| 1485 } | 1484 } |
| 1486 | 1485 |
| 1487 Handle<Object> Error = GetProperty(js_global, "Error"); | 1486 Handle<Object> Error = GetProperty(js_global, "Error"); |
| 1488 if (Error->IsJSObject()) { | 1487 if (Error->IsJSObject()) { |
| 1489 Handle<String> name = Factory::LookupAsciiSymbol("stackTraceLimit"); | 1488 Handle<String> name = Factory::LookupAsciiSymbol("stackTraceLimit"); |
| 1490 SetProperty(Handle<JSObject>::cast(Error), | 1489 SetLocalPropertyNoThrow(Handle<JSObject>::cast(Error), |
| 1491 name, | 1490 name, |
| 1492 Handle<Smi>(Smi::FromInt(FLAG_stack_trace_limit)), | 1491 Handle<Smi>(Smi::FromInt(FLAG_stack_trace_limit)), |
| 1493 NONE); | 1492 NONE); |
| 1494 } | 1493 } |
| 1495 | 1494 |
| 1496 #ifdef ENABLE_DEBUGGER_SUPPORT | 1495 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 1497 // Expose the debug global object in global if a name for it is specified. | 1496 // Expose the debug global object in global if a name for it is specified. |
| 1498 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { | 1497 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { |
| 1499 // If loading fails we just bail out without installing the | 1498 // If loading fails we just bail out without installing the |
| 1500 // debugger but without tanking the whole context. | 1499 // debugger but without tanking the whole context. |
| 1501 if (!Debug::Load()) return; | 1500 if (!Debug::Load()) return; |
| 1502 // Set the security token for the debugger context to the same as | 1501 // Set the security token for the debugger context to the same as |
| 1503 // the shell global context to allow calling between these (otherwise | 1502 // the shell global context to allow calling between these (otherwise |
| 1504 // exposing debug global object doesn't make much sense). | 1503 // exposing debug global object doesn't make much sense). |
| 1505 Debug::debug_context()->set_security_token( | 1504 Debug::debug_context()->set_security_token( |
| 1506 global_context->security_token()); | 1505 global_context->security_token()); |
| 1507 | 1506 |
| 1508 Handle<String> debug_string = | 1507 Handle<String> debug_string = |
| 1509 Factory::LookupAsciiSymbol(FLAG_expose_debug_as); | 1508 Factory::LookupAsciiSymbol(FLAG_expose_debug_as); |
| 1510 SetProperty(js_global, debug_string, | 1509 Handle<Object> global_proxy(Debug::debug_context()->global_proxy()); |
| 1511 Handle<Object>(Debug::debug_context()->global_proxy()), DONT_ENUM); | 1510 SetLocalPropertyNoThrow(js_global, debug_string, global_proxy, DONT_ENUM); |
| 1512 } | 1511 } |
| 1513 #endif | 1512 #endif |
| 1514 } | 1513 } |
| 1515 | 1514 |
| 1516 | 1515 |
| 1517 bool Genesis::InstallExtensions(Handle<Context> global_context, | 1516 bool Genesis::InstallExtensions(Handle<Context> global_context, |
| 1518 v8::ExtensionConfiguration* extensions) { | 1517 v8::ExtensionConfiguration* extensions) { |
| 1519 // Clear coloring of extension list | 1518 // Clear coloring of extension list |
| 1520 v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension(); | 1519 v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension(); |
| 1521 while (current != NULL) { | 1520 while (current != NULL) { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 Handle<DescriptorArray> descs = | 1671 Handle<DescriptorArray> descs = |
| 1673 Handle<DescriptorArray>(from->map()->instance_descriptors()); | 1672 Handle<DescriptorArray>(from->map()->instance_descriptors()); |
| 1674 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 1673 for (int i = 0; i < descs->number_of_descriptors(); i++) { |
| 1675 PropertyDetails details = PropertyDetails(descs->GetDetails(i)); | 1674 PropertyDetails details = PropertyDetails(descs->GetDetails(i)); |
| 1676 switch (details.type()) { | 1675 switch (details.type()) { |
| 1677 case FIELD: { | 1676 case FIELD: { |
| 1678 HandleScope inner; | 1677 HandleScope inner; |
| 1679 Handle<String> key = Handle<String>(descs->GetKey(i)); | 1678 Handle<String> key = Handle<String>(descs->GetKey(i)); |
| 1680 int index = descs->GetFieldIndex(i); | 1679 int index = descs->GetFieldIndex(i); |
| 1681 Handle<Object> value = Handle<Object>(from->FastPropertyAt(index)); | 1680 Handle<Object> value = Handle<Object>(from->FastPropertyAt(index)); |
| 1682 SetProperty(to, key, value, details.attributes()); | 1681 SetLocalPropertyNoThrow(to, key, value, details.attributes()); |
| 1683 break; | 1682 break; |
| 1684 } | 1683 } |
| 1685 case CONSTANT_FUNCTION: { | 1684 case CONSTANT_FUNCTION: { |
| 1686 HandleScope inner; | 1685 HandleScope inner; |
| 1687 Handle<String> key = Handle<String>(descs->GetKey(i)); | 1686 Handle<String> key = Handle<String>(descs->GetKey(i)); |
| 1688 Handle<JSFunction> fun = | 1687 Handle<JSFunction> fun = |
| 1689 Handle<JSFunction>(descs->GetConstantFunction(i)); | 1688 Handle<JSFunction>(descs->GetConstantFunction(i)); |
| 1690 SetProperty(to, key, fun, details.attributes()); | 1689 SetLocalPropertyNoThrow(to, key, fun, details.attributes()); |
| 1691 break; | 1690 break; |
| 1692 } | 1691 } |
| 1693 case CALLBACKS: { | 1692 case CALLBACKS: { |
| 1694 LookupResult result; | 1693 LookupResult result; |
| 1695 to->LocalLookup(descs->GetKey(i), &result); | 1694 to->LocalLookup(descs->GetKey(i), &result); |
| 1696 // If the property is already there we skip it | 1695 // If the property is already there we skip it |
| 1697 if (result.IsProperty()) continue; | 1696 if (result.IsProperty()) continue; |
| 1698 HandleScope inner; | 1697 HandleScope inner; |
| 1699 ASSERT(!to->HasFastProperties()); | 1698 ASSERT(!to->HasFastProperties()); |
| 1700 // Add to dictionary. | 1699 // Add to dictionary. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1730 LookupResult result; | 1729 LookupResult result; |
| 1731 to->LocalLookup(String::cast(raw_key), &result); | 1730 to->LocalLookup(String::cast(raw_key), &result); |
| 1732 if (result.IsProperty()) continue; | 1731 if (result.IsProperty()) continue; |
| 1733 // Set the property. | 1732 // Set the property. |
| 1734 Handle<String> key = Handle<String>(String::cast(raw_key)); | 1733 Handle<String> key = Handle<String>(String::cast(raw_key)); |
| 1735 Handle<Object> value = Handle<Object>(properties->ValueAt(i)); | 1734 Handle<Object> value = Handle<Object>(properties->ValueAt(i)); |
| 1736 if (value->IsJSGlobalPropertyCell()) { | 1735 if (value->IsJSGlobalPropertyCell()) { |
| 1737 value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value()); | 1736 value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value()); |
| 1738 } | 1737 } |
| 1739 PropertyDetails details = properties->DetailsAt(i); | 1738 PropertyDetails details = properties->DetailsAt(i); |
| 1740 SetProperty(to, key, value, details.attributes()); | 1739 SetLocalPropertyNoThrow(to, key, value, details.attributes()); |
| 1741 } | 1740 } |
| 1742 } | 1741 } |
| 1743 } | 1742 } |
| 1744 } | 1743 } |
| 1745 | 1744 |
| 1746 | 1745 |
| 1747 void Genesis::TransferIndexedProperties(Handle<JSObject> from, | 1746 void Genesis::TransferIndexedProperties(Handle<JSObject> from, |
| 1748 Handle<JSObject> to) { | 1747 Handle<JSObject> to) { |
| 1749 // Cloning the elements array is sufficient. | 1748 // Cloning the elements array is sufficient. |
| 1750 Handle<FixedArray> from_elements = | 1749 Handle<FixedArray> from_elements = |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1880 } | 1879 } |
| 1881 | 1880 |
| 1882 | 1881 |
| 1883 // Restore statics that are thread local. | 1882 // Restore statics that are thread local. |
| 1884 char* BootstrapperActive::RestoreState(char* from) { | 1883 char* BootstrapperActive::RestoreState(char* from) { |
| 1885 nesting_ = *reinterpret_cast<int*>(from); | 1884 nesting_ = *reinterpret_cast<int*>(from); |
| 1886 return from + sizeof(nesting_); | 1885 return from + sizeof(nesting_); |
| 1887 } | 1886 } |
| 1888 | 1887 |
| 1889 } } // namespace v8::internal | 1888 } } // namespace v8::internal |
| OLD | NEW |