OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 | 1087 |
1088 result->LocalLookup(heap->length_symbol(), &lookup); | 1088 result->LocalLookup(heap->length_symbol(), &lookup); |
1089 ASSERT(lookup.IsFound() && (lookup.type() == FIELD)); | 1089 ASSERT(lookup.IsFound() && (lookup.type() == FIELD)); |
1090 ASSERT(lookup.GetFieldIndex() == Heap::kArgumentsLengthIndex); | 1090 ASSERT(lookup.GetFieldIndex() == Heap::kArgumentsLengthIndex); |
1091 | 1091 |
1092 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex); | 1092 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex); |
1093 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); | 1093 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); |
1094 | 1094 |
1095 // Check the state of the object. | 1095 // Check the state of the object. |
1096 ASSERT(result->HasFastProperties()); | 1096 ASSERT(result->HasFastProperties()); |
1097 ASSERT(result->HasFastElements()); | 1097 ASSERT(result->HasFastObjectElements()); |
1098 #endif | 1098 #endif |
1099 } | 1099 } |
1100 | 1100 |
1101 { // --- aliased_arguments_boilerplate_ | 1101 { // --- aliased_arguments_boilerplate_ |
1102 // Set up a well-formed parameter map to make assertions happy. | 1102 // Set up a well-formed parameter map to make assertions happy. |
1103 Handle<FixedArray> elements = factory->NewFixedArray(2); | 1103 Handle<FixedArray> elements = factory->NewFixedArray(2); |
1104 elements->set_map(heap->non_strict_arguments_elements_map()); | 1104 elements->set_map(heap->non_strict_arguments_elements_map()); |
1105 Handle<FixedArray> array; | 1105 Handle<FixedArray> array; |
1106 array = factory->NewFixedArray(0); | 1106 array = factory->NewFixedArray(0); |
1107 elements->set(0, *array); | 1107 elements->set(0, *array); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 #ifdef DEBUG | 1180 #ifdef DEBUG |
1181 LookupResult lookup(isolate); | 1181 LookupResult lookup(isolate); |
1182 result->LocalLookup(heap->length_symbol(), &lookup); | 1182 result->LocalLookup(heap->length_symbol(), &lookup); |
1183 ASSERT(lookup.IsFound() && (lookup.type() == FIELD)); | 1183 ASSERT(lookup.IsFound() && (lookup.type() == FIELD)); |
1184 ASSERT(lookup.GetFieldIndex() == Heap::kArgumentsLengthIndex); | 1184 ASSERT(lookup.GetFieldIndex() == Heap::kArgumentsLengthIndex); |
1185 | 1185 |
1186 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); | 1186 ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex); |
1187 | 1187 |
1188 // Check the state of the object. | 1188 // Check the state of the object. |
1189 ASSERT(result->HasFastProperties()); | 1189 ASSERT(result->HasFastProperties()); |
1190 ASSERT(result->HasFastElements()); | 1190 ASSERT(result->HasFastObjectElements()); |
1191 #endif | 1191 #endif |
1192 } | 1192 } |
1193 | 1193 |
1194 { // --- context extension | 1194 { // --- context extension |
1195 // Create a function for the context extension objects. | 1195 // Create a function for the context extension objects. |
1196 Handle<Code> code = Handle<Code>( | 1196 Handle<Code> code = Handle<Code>( |
1197 isolate->builtins()->builtin(Builtins::kIllegal)); | 1197 isolate->builtins()->builtin(Builtins::kIllegal)); |
1198 Handle<JSFunction> context_extension_fun = | 1198 Handle<JSFunction> context_extension_fun = |
1199 factory->NewFunction(factory->empty_symbol(), | 1199 factory->NewFunction(factory->empty_symbol(), |
1200 JS_CONTEXT_EXTENSION_OBJECT_TYPE, | 1200 JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 | 1630 |
1631 // InternalArrays should not use Smi-Only array optimizations. There are too | 1631 // InternalArrays should not use Smi-Only array optimizations. There are too |
1632 // many places in the C++ runtime code (e.g. RegEx) that assume that | 1632 // many places in the C++ runtime code (e.g. RegEx) that assume that |
1633 // elements in InternalArrays can be set to non-Smi values without going | 1633 // elements in InternalArrays can be set to non-Smi values without going |
1634 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT | 1634 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT |
1635 // transition easy to trap. Moreover, they rarely are smi-only. | 1635 // transition easy to trap. Moreover, they rarely are smi-only. |
1636 MaybeObject* maybe_map = | 1636 MaybeObject* maybe_map = |
1637 array_function->initial_map()->CopyDropTransitions(); | 1637 array_function->initial_map()->CopyDropTransitions(); |
1638 Map* new_map; | 1638 Map* new_map; |
1639 if (!maybe_map->To<Map>(&new_map)) return false; | 1639 if (!maybe_map->To<Map>(&new_map)) return false; |
1640 new_map->set_elements_kind(FAST_ELEMENTS); | 1640 new_map->set_elements_kind(FAST_HOLEY_ELEMENTS); |
1641 array_function->set_initial_map(new_map); | 1641 array_function->set_initial_map(new_map); |
1642 | 1642 |
1643 // Make "length" magic on instances. | 1643 // Make "length" magic on instances. |
1644 Handle<DescriptorArray> array_descriptors = | 1644 Handle<DescriptorArray> array_descriptors = |
1645 factory()->CopyAppendForeignDescriptor( | 1645 factory()->CopyAppendForeignDescriptor( |
1646 factory()->empty_descriptor_array(), | 1646 factory()->empty_descriptor_array(), |
1647 factory()->length_symbol(), | 1647 factory()->length_symbol(), |
1648 factory()->NewForeign(&Accessors::ArrayLength), | 1648 factory()->NewForeign(&Accessors::ArrayLength), |
1649 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE)); | 1649 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE)); |
1650 | 1650 |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2368 return from + sizeof(NestingCounterType); | 2368 return from + sizeof(NestingCounterType); |
2369 } | 2369 } |
2370 | 2370 |
2371 | 2371 |
2372 // Called when the top-level V8 mutex is destroyed. | 2372 // Called when the top-level V8 mutex is destroyed. |
2373 void Bootstrapper::FreeThreadResources() { | 2373 void Bootstrapper::FreeThreadResources() { |
2374 ASSERT(!IsActive()); | 2374 ASSERT(!IsActive()); |
2375 } | 2375 } |
2376 | 2376 |
2377 } } // namespace v8::internal | 2377 } } // namespace v8::internal |
OLD | NEW |