| 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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 | 1510 |
| 1511 if ((receiver_map->instance_type() & kNotStringTag) == 0) { | 1511 if ((receiver_map->instance_type() & kNotStringTag) == 0) { |
| 1512 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); | 1512 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); |
| 1513 } else { | 1513 } else { |
| 1514 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1514 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1515 ElementsKind elements_kind = receiver_map->elements_kind(); | 1515 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1516 | 1516 |
| 1517 if (IsFastElementsKind(elements_kind) || | 1517 if (IsFastElementsKind(elements_kind) || |
| 1518 IsExternalArrayElementsKind(elements_kind)) { | 1518 IsExternalArrayElementsKind(elements_kind)) { |
| 1519 cached_stub = | 1519 cached_stub = |
| 1520 KeyedLoadFastElementStub(is_js_array, elements_kind).GetCode(); | 1520 KeyedLoadFastElementStub(is_js_array, |
| 1521 elements_kind).GetCode(isolate()); |
| 1521 } else { | 1522 } else { |
| 1522 ASSERT(elements_kind == DICTIONARY_ELEMENTS); | 1523 ASSERT(elements_kind == DICTIONARY_ELEMENTS); |
| 1523 cached_stub = KeyedLoadDictionaryElementStub().GetCode(); | 1524 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate()); |
| 1524 } | 1525 } |
| 1525 } | 1526 } |
| 1526 | 1527 |
| 1527 handler_ics.Add(cached_stub); | 1528 handler_ics.Add(cached_stub); |
| 1528 } | 1529 } |
| 1529 Handle<Code> code = CompileLoadPolymorphic(receiver_maps, &handler_ics); | 1530 Handle<Code> code = CompileLoadPolymorphic(receiver_maps, &handler_ics); |
| 1530 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment(); | 1531 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment(); |
| 1531 PROFILE(isolate(), | 1532 PROFILE(isolate(), |
| 1532 CodeCreateEvent(Logger::KEYED_LOAD_POLYMORPHIC_IC_TAG, *code, 0)); | 1533 CodeCreateEvent(Logger::KEYED_LOAD_POLYMORPHIC_IC_TAG, *code, 0)); |
| 1533 return code; | 1534 return code; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1577 // to be. Not all the elements are in place yet, pessimistic elements | 1578 // to be. Not all the elements are in place yet, pessimistic elements |
| 1578 // transitions are still important for performance. | 1579 // transitions are still important for performance. |
| 1579 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1580 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1580 ElementsKind elements_kind = receiver_map->elements_kind(); | 1581 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1581 if (!transitioned_map.is_null()) { | 1582 if (!transitioned_map.is_null()) { |
| 1582 cached_stub = ElementsTransitionAndStoreStub( | 1583 cached_stub = ElementsTransitionAndStoreStub( |
| 1583 elements_kind, | 1584 elements_kind, |
| 1584 transitioned_map->elements_kind(), | 1585 transitioned_map->elements_kind(), |
| 1585 is_js_array, | 1586 is_js_array, |
| 1586 strict_mode_, | 1587 strict_mode_, |
| 1587 grow_mode_).GetCode(); | 1588 grow_mode_).GetCode(isolate()); |
| 1588 } else { | 1589 } else { |
| 1589 cached_stub = KeyedStoreElementStub( | 1590 cached_stub = KeyedStoreElementStub( |
| 1590 is_js_array, | 1591 is_js_array, |
| 1591 elements_kind, | 1592 elements_kind, |
| 1592 grow_mode_).GetCode(); | 1593 grow_mode_).GetCode(isolate()); |
| 1593 } | 1594 } |
| 1594 ASSERT(!cached_stub.is_null()); | 1595 ASSERT(!cached_stub.is_null()); |
| 1595 handler_ics.Add(cached_stub); | 1596 handler_ics.Add(cached_stub); |
| 1596 transitioned_maps.Add(transitioned_map); | 1597 transitioned_maps.Add(transitioned_map); |
| 1597 } | 1598 } |
| 1598 Handle<Code> code = | 1599 Handle<Code> code = |
| 1599 CompileStorePolymorphic(receiver_maps, &handler_ics, &transitioned_maps); | 1600 CompileStorePolymorphic(receiver_maps, &handler_ics, &transitioned_maps); |
| 1600 isolate()->counters()->keyed_store_polymorphic_stubs()->Increment(); | 1601 isolate()->counters()->keyed_store_polymorphic_stubs()->Increment(); |
| 1601 PROFILE(isolate(), | 1602 PROFILE(isolate(), |
| 1602 CodeCreateEvent(Logger::KEYED_STORE_POLYMORPHIC_IC_TAG, *code, 0)); | 1603 CodeCreateEvent(Logger::KEYED_STORE_POLYMORPHIC_IC_TAG, *code, 0)); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 Handle<FunctionTemplateInfo>( | 1765 Handle<FunctionTemplateInfo>( |
| 1765 FunctionTemplateInfo::cast(signature->receiver())); | 1766 FunctionTemplateInfo::cast(signature->receiver())); |
| 1766 } | 1767 } |
| 1767 } | 1768 } |
| 1768 | 1769 |
| 1769 is_simple_api_call_ = true; | 1770 is_simple_api_call_ = true; |
| 1770 } | 1771 } |
| 1771 | 1772 |
| 1772 | 1773 |
| 1773 } } // namespace v8::internal | 1774 } } // namespace v8::internal |
| OLD | NEW |