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 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 array_function->shared()->set_construct_stub( | 1625 array_function->shared()->set_construct_stub( |
1626 isolate()->builtins()->builtin(Builtins::kArrayConstructCode)); | 1626 isolate()->builtins()->builtin(Builtins::kArrayConstructCode)); |
1627 array_function->shared()->DontAdaptArguments(); | 1627 array_function->shared()->DontAdaptArguments(); |
1628 | 1628 |
1629 // InternalArrays should not use Smi-Only array optimizations. There are too | 1629 // InternalArrays should not use Smi-Only array optimizations. There are too |
1630 // many places in the C++ runtime code (e.g. RegEx) that assume that | 1630 // many places in the C++ runtime code (e.g. RegEx) that assume that |
1631 // elements in InternalArrays can be set to non-Smi values without going | 1631 // elements in InternalArrays can be set to non-Smi values without going |
1632 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT | 1632 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT |
1633 // transition easy to trap. Moreover, they rarely are smi-only. | 1633 // transition easy to trap. Moreover, they rarely are smi-only. |
1634 MaybeObject* maybe_map = | 1634 MaybeObject* maybe_map = |
1635 array_function->initial_map()->CopyDropTransitions(); | 1635 array_function->initial_map()->CopyDropTransitions( |
| 1636 DescriptorArray::MAY_BE_SHARED); |
1636 Map* new_map; | 1637 Map* new_map; |
1637 if (!maybe_map->To<Map>(&new_map)) return false; | 1638 if (!maybe_map->To(&new_map)) return false; |
1638 new_map->set_elements_kind(FAST_HOLEY_ELEMENTS); | 1639 new_map->set_elements_kind(FAST_HOLEY_ELEMENTS); |
1639 array_function->set_initial_map(new_map); | 1640 array_function->set_initial_map(new_map); |
1640 | 1641 |
1641 // Make "length" magic on instances. | 1642 // Make "length" magic on instances. |
1642 Handle<DescriptorArray> array_descriptors = | 1643 Handle<DescriptorArray> array_descriptors = |
1643 factory()->CopyAppendForeignDescriptor( | 1644 factory()->CopyAppendForeignDescriptor( |
1644 factory()->empty_descriptor_array(), | 1645 factory()->empty_descriptor_array(), |
1645 factory()->length_symbol(), | 1646 factory()->length_symbol(), |
1646 factory()->NewForeign(&Accessors::ArrayLength), | 1647 factory()->NewForeign(&Accessors::ArrayLength), |
1647 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE)); | 1648 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE)); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2188 ASSERT(!to->HasFastProperties()); | 2189 ASSERT(!to->HasFastProperties()); |
2189 // Add to dictionary. | 2190 // Add to dictionary. |
2190 Handle<String> key = Handle<String>(descs->GetKey(i)); | 2191 Handle<String> key = Handle<String>(descs->GetKey(i)); |
2191 Handle<Object> callbacks(descs->GetCallbacksObject(i)); | 2192 Handle<Object> callbacks(descs->GetCallbacksObject(i)); |
2192 PropertyDetails d = | 2193 PropertyDetails d = |
2193 PropertyDetails(details.attributes(), CALLBACKS, details.index()); | 2194 PropertyDetails(details.attributes(), CALLBACKS, details.index()); |
2194 JSObject::SetNormalizedProperty(to, key, callbacks, d); | 2195 JSObject::SetNormalizedProperty(to, key, callbacks, d); |
2195 break; | 2196 break; |
2196 } | 2197 } |
2197 case MAP_TRANSITION: | 2198 case MAP_TRANSITION: |
2198 case ELEMENTS_TRANSITION: | |
2199 case CONSTANT_TRANSITION: | 2199 case CONSTANT_TRANSITION: |
2200 case NULL_DESCRIPTOR: | 2200 case NULL_DESCRIPTOR: |
2201 // Ignore non-properties. | 2201 // Ignore non-properties. |
2202 break; | 2202 break; |
2203 case NORMAL: | 2203 case NORMAL: |
2204 // Do not occur since the from object has fast properties. | 2204 // Do not occur since the from object has fast properties. |
2205 case HANDLER: | 2205 case HANDLER: |
2206 case INTERCEPTOR: | 2206 case INTERCEPTOR: |
2207 // No element in instance descriptors have proxy or interceptor type. | 2207 // No element in instance descriptors have proxy or interceptor type. |
2208 UNREACHABLE(); | 2208 UNREACHABLE(); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2366 return from + sizeof(NestingCounterType); | 2366 return from + sizeof(NestingCounterType); |
2367 } | 2367 } |
2368 | 2368 |
2369 | 2369 |
2370 // Called when the top-level V8 mutex is destroyed. | 2370 // Called when the top-level V8 mutex is destroyed. |
2371 void Bootstrapper::FreeThreadResources() { | 2371 void Bootstrapper::FreeThreadResources() { |
2372 ASSERT(!IsActive()); | 2372 ASSERT(!IsActive()); |
2373 } | 2373 } |
2374 | 2374 |
2375 } } // namespace v8::internal | 2375 } } // namespace v8::internal |
OLD | NEW |