| 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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 GenerateStoreViaSetter(masm(), setter); | 1544 GenerateStoreViaSetter(masm(), setter); |
| 1545 | 1545 |
| 1546 return GetCode(kind(), Code::FAST, name); | 1546 return GetCode(kind(), Code::FAST, name); |
| 1547 } | 1547 } |
| 1548 | 1548 |
| 1549 | 1549 |
| 1550 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( | 1550 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( |
| 1551 Handle<Map> receiver_map) { | 1551 Handle<Map> receiver_map) { |
| 1552 ElementsKind elements_kind = receiver_map->elements_kind(); | 1552 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1553 if (receiver_map->has_fast_elements() || | 1553 if (receiver_map->has_fast_elements() || |
| 1554 receiver_map->has_external_array_elements()) { | 1554 receiver_map->has_external_array_elements() || |
| 1555 receiver_map->has_fixed_typed_array_elements()) { |
| 1555 Handle<Code> stub = KeyedLoadFastElementStub( | 1556 Handle<Code> stub = KeyedLoadFastElementStub( |
| 1556 receiver_map->instance_type() == JS_ARRAY_TYPE, | 1557 receiver_map->instance_type() == JS_ARRAY_TYPE, |
| 1557 elements_kind).GetCode(isolate()); | 1558 elements_kind).GetCode(isolate()); |
| 1558 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); | 1559 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); |
| 1559 } else { | 1560 } else { |
| 1560 Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads | 1561 Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads |
| 1561 ? KeyedLoadDictionaryElementStub().GetCode(isolate()) | 1562 ? KeyedLoadDictionaryElementStub().GetCode(isolate()) |
| 1562 : KeyedLoadDictionaryElementPlatformStub().GetCode(isolate()); | 1563 : KeyedLoadDictionaryElementPlatformStub().GetCode(isolate()); |
| 1563 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); | 1564 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); |
| 1564 } | 1565 } |
| 1565 | 1566 |
| 1566 TailCallBuiltin(masm(), Builtins::kKeyedLoadIC_Miss); | 1567 TailCallBuiltin(masm(), Builtins::kKeyedLoadIC_Miss); |
| 1567 | 1568 |
| 1568 // Return the generated code. | 1569 // Return the generated code. |
| 1569 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); | 1570 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); |
| 1570 } | 1571 } |
| 1571 | 1572 |
| 1572 | 1573 |
| 1573 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( | 1574 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( |
| 1574 Handle<Map> receiver_map) { | 1575 Handle<Map> receiver_map) { |
| 1575 ElementsKind elements_kind = receiver_map->elements_kind(); | 1576 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1576 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1577 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1577 Handle<Code> stub; | 1578 Handle<Code> stub; |
| 1578 if (receiver_map->has_fast_elements() || | 1579 if (receiver_map->has_fast_elements() || |
| 1579 receiver_map->has_external_array_elements()) { | 1580 receiver_map->has_external_array_elements() || |
| 1581 receiver_map->has_fixed_typed_array_elements()) { |
| 1580 stub = KeyedStoreFastElementStub( | 1582 stub = KeyedStoreFastElementStub( |
| 1581 is_jsarray, | 1583 is_jsarray, |
| 1582 elements_kind, | 1584 elements_kind, |
| 1583 store_mode()).GetCode(isolate()); | 1585 store_mode()).GetCode(isolate()); |
| 1584 } else { | 1586 } else { |
| 1585 stub = KeyedStoreElementStub(is_jsarray, | 1587 stub = KeyedStoreElementStub(is_jsarray, |
| 1586 elements_kind, | 1588 elements_kind, |
| 1587 store_mode()).GetCode(isolate()); | 1589 store_mode()).GetCode(isolate()); |
| 1588 } | 1590 } |
| 1589 | 1591 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1665 Handle<Map> receiver_map = receiver_maps->at(i); | 1667 Handle<Map> receiver_map = receiver_maps->at(i); |
| 1666 Handle<Code> cached_stub; | 1668 Handle<Code> cached_stub; |
| 1667 | 1669 |
| 1668 if ((receiver_map->instance_type() & kNotStringTag) == 0) { | 1670 if ((receiver_map->instance_type() & kNotStringTag) == 0) { |
| 1669 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); | 1671 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); |
| 1670 } else { | 1672 } else { |
| 1671 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1673 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1672 ElementsKind elements_kind = receiver_map->elements_kind(); | 1674 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1673 | 1675 |
| 1674 if (IsFastElementsKind(elements_kind) || | 1676 if (IsFastElementsKind(elements_kind) || |
| 1675 IsExternalArrayElementsKind(elements_kind)) { | 1677 IsExternalArrayElementsKind(elements_kind) || |
| 1678 IsFixedTypedArrayElementsKind(elements_kind)) { |
| 1676 cached_stub = | 1679 cached_stub = |
| 1677 KeyedLoadFastElementStub(is_js_array, | 1680 KeyedLoadFastElementStub(is_js_array, |
| 1678 elements_kind).GetCode(isolate()); | 1681 elements_kind).GetCode(isolate()); |
| 1679 } else { | 1682 } else { |
| 1680 ASSERT(elements_kind == DICTIONARY_ELEMENTS); | 1683 ASSERT(elements_kind == DICTIONARY_ELEMENTS); |
| 1681 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate()); | 1684 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate()); |
| 1682 } | 1685 } |
| 1683 } | 1686 } |
| 1684 | 1687 |
| 1685 handlers->Add(cached_stub); | 1688 handlers->Add(cached_stub); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1706 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1709 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1707 ElementsKind elements_kind = receiver_map->elements_kind(); | 1710 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1708 if (!transitioned_map.is_null()) { | 1711 if (!transitioned_map.is_null()) { |
| 1709 cached_stub = ElementsTransitionAndStoreStub( | 1712 cached_stub = ElementsTransitionAndStoreStub( |
| 1710 elements_kind, | 1713 elements_kind, |
| 1711 transitioned_map->elements_kind(), | 1714 transitioned_map->elements_kind(), |
| 1712 is_js_array, | 1715 is_js_array, |
| 1713 store_mode()).GetCode(isolate()); | 1716 store_mode()).GetCode(isolate()); |
| 1714 } else { | 1717 } else { |
| 1715 if (receiver_map->has_fast_elements() || | 1718 if (receiver_map->has_fast_elements() || |
| 1716 receiver_map->has_external_array_elements()) { | 1719 receiver_map->has_external_array_elements() || |
| 1720 receiver_map->has_fixed_typed_array_elements()) { |
| 1717 cached_stub = KeyedStoreFastElementStub( | 1721 cached_stub = KeyedStoreFastElementStub( |
| 1718 is_js_array, | 1722 is_js_array, |
| 1719 elements_kind, | 1723 elements_kind, |
| 1720 store_mode()).GetCode(isolate()); | 1724 store_mode()).GetCode(isolate()); |
| 1721 } else { | 1725 } else { |
| 1722 cached_stub = KeyedStoreElementStub( | 1726 cached_stub = KeyedStoreElementStub( |
| 1723 is_js_array, | 1727 is_js_array, |
| 1724 elements_kind, | 1728 elements_kind, |
| 1725 store_mode()).GetCode(isolate()); | 1729 store_mode()).GetCode(isolate()); |
| 1726 } | 1730 } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1900 Handle<FunctionTemplateInfo>( | 1904 Handle<FunctionTemplateInfo>( |
| 1901 FunctionTemplateInfo::cast(signature->receiver())); | 1905 FunctionTemplateInfo::cast(signature->receiver())); |
| 1902 } | 1906 } |
| 1903 } | 1907 } |
| 1904 | 1908 |
| 1905 is_simple_api_call_ = true; | 1909 is_simple_api_call_ = true; |
| 1906 } | 1910 } |
| 1907 | 1911 |
| 1908 | 1912 |
| 1909 } } // namespace v8::internal | 1913 } } // namespace v8::internal |
| OLD | NEW |