OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex); | 1077 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex); |
1078 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); | 1078 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); |
1079 | 1079 |
1080 // Check the state of the object. | 1080 // Check the state of the object. |
1081 ASSERT(result->HasFastProperties()); | 1081 ASSERT(result->HasFastProperties()); |
1082 ASSERT(result->HasFastElements()); | 1082 ASSERT(result->HasFastElements()); |
1083 #endif | 1083 #endif |
1084 } | 1084 } |
1085 | 1085 |
1086 { // --- aliased_arguments_boilerplate_ | 1086 { // --- aliased_arguments_boilerplate_ |
1087 Handle<Map> old_map(global_context()->arguments_boilerplate()->map()); | |
1088 Handle<Map> new_map = factory->CopyMapDropTransitions(old_map); | |
1089 new_map->set_pre_allocated_property_fields(2); | |
1090 Handle<JSObject> result = factory->NewJSObjectFromMap(new_map); | |
1091 new_map->set_elements_kind(NON_STRICT_ARGUMENTS_ELEMENTS); | |
1092 // Set up a well-formed parameter map to make assertions happy. | 1087 // Set up a well-formed parameter map to make assertions happy. |
1093 Handle<FixedArray> elements = factory->NewFixedArray(2); | 1088 Handle<FixedArray> elements = factory->NewFixedArray(2); |
1094 elements->set_map(heap->non_strict_arguments_elements_map()); | 1089 elements->set_map(heap->non_strict_arguments_elements_map()); |
1095 Handle<FixedArray> array; | 1090 Handle<FixedArray> array; |
1096 array = factory->NewFixedArray(0); | 1091 array = factory->NewFixedArray(0); |
1097 elements->set(0, *array); | 1092 elements->set(0, *array); |
1098 array = factory->NewFixedArray(0); | 1093 array = factory->NewFixedArray(0); |
1099 elements->set(1, *array); | 1094 elements->set(1, *array); |
1100 Handle<Map> non_strict_arguments_elements_map = | 1095 |
1101 factory->GetElementsTransitionMap(result, | 1096 Handle<Map> old_map(global_context()->arguments_boilerplate()->map()); |
1102 NON_STRICT_ARGUMENTS_ELEMENTS); | 1097 Handle<Map> new_map = factory->CopyMapDropTransitions(old_map); |
1103 result->set_map(*non_strict_arguments_elements_map); | 1098 new_map->set_pre_allocated_property_fields(2); |
| 1099 Handle<JSObject> result = factory->NewJSObjectFromMap(new_map); |
| 1100 // Set elements kind after allocating the object because |
| 1101 // NewJSObjectFromMap assumes a fast elements map. |
| 1102 new_map->set_elements_kind(NON_STRICT_ARGUMENTS_ELEMENTS); |
| 1103 result->set_elements(*elements); |
1104 ASSERT(result->HasNonStrictArgumentsElements()); | 1104 ASSERT(result->HasNonStrictArgumentsElements()); |
1105 result->set_elements(*elements); | |
1106 global_context()->set_aliased_arguments_boilerplate(*result); | 1105 global_context()->set_aliased_arguments_boilerplate(*result); |
1107 } | 1106 } |
1108 | 1107 |
1109 { // --- strict mode arguments boilerplate | 1108 { // --- strict mode arguments boilerplate |
1110 const PropertyAttributes attributes = | 1109 const PropertyAttributes attributes = |
1111 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 1110 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
1112 | 1111 |
1113 // Create the ThrowTypeError functions. | 1112 // Create the ThrowTypeError functions. |
1114 Handle<FixedArray> callee = factory->NewFixedArray(2, TENURED); | 1113 Handle<FixedArray> callee = factory->NewFixedArray(2, TENURED); |
1115 Handle<FixedArray> caller = factory->NewFixedArray(2, TENURED); | 1114 Handle<FixedArray> caller = factory->NewFixedArray(2, TENURED); |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2266 return from + sizeof(NestingCounterType); | 2265 return from + sizeof(NestingCounterType); |
2267 } | 2266 } |
2268 | 2267 |
2269 | 2268 |
2270 // Called when the top-level V8 mutex is destroyed. | 2269 // Called when the top-level V8 mutex is destroyed. |
2271 void Bootstrapper::FreeThreadResources() { | 2270 void Bootstrapper::FreeThreadResources() { |
2272 ASSERT(!IsActive()); | 2271 ASSERT(!IsActive()); |
2273 } | 2272 } |
2274 | 2273 |
2275 } } // namespace v8::internal | 2274 } } // namespace v8::internal |
OLD | NEW |