OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/field-index.h" | 8 #include "src/field-index.h" |
9 #include "src/hydrogen.h" | 9 #include "src/hydrogen.h" |
10 #include "src/lithium.h" | 10 #include "src/lithium.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 535 |
536 | 536 |
537 Handle<Code> CreateAllocationSiteStub::GenerateCode() { | 537 Handle<Code> CreateAllocationSiteStub::GenerateCode() { |
538 return DoGenerateCode(this); | 538 return DoGenerateCode(this); |
539 } | 539 } |
540 | 540 |
541 | 541 |
542 template <> | 542 template <> |
543 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { | 543 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { |
544 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 544 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
545 GetParameter(LoadConvention::kReceiverIndex), | 545 GetParameter(LoadDescriptor::kReceiverIndex), |
546 GetParameter(LoadConvention::kNameIndex), NULL, | 546 GetParameter(LoadDescriptor::kNameIndex), NULL, |
547 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, | 547 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, |
548 NEVER_RETURN_HOLE, STANDARD_STORE); | 548 NEVER_RETURN_HOLE, STANDARD_STORE); |
549 return load; | 549 return load; |
550 } | 550 } |
551 | 551 |
552 | 552 |
553 Handle<Code> LoadFastElementStub::GenerateCode() { | 553 Handle<Code> LoadFastElementStub::GenerateCode() { |
554 return DoGenerateCode(this); | 554 return DoGenerateCode(this); |
555 } | 555 } |
556 | 556 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 | 650 |
651 | 651 |
652 Handle<Code> StringLengthStub::GenerateCode() { | 652 Handle<Code> StringLengthStub::GenerateCode() { |
653 return DoGenerateCode(this); | 653 return DoGenerateCode(this); |
654 } | 654 } |
655 | 655 |
656 | 656 |
657 template <> | 657 template <> |
658 HValue* CodeStubGraphBuilder<StoreFastElementStub>::BuildCodeStub() { | 658 HValue* CodeStubGraphBuilder<StoreFastElementStub>::BuildCodeStub() { |
659 BuildUncheckedMonomorphicElementAccess( | 659 BuildUncheckedMonomorphicElementAccess( |
660 GetParameter(StoreConvention::kReceiverIndex), | 660 GetParameter(StoreDescriptor::kReceiverIndex), |
661 GetParameter(StoreConvention::kNameIndex), | 661 GetParameter(StoreDescriptor::kNameIndex), |
662 GetParameter(StoreConvention::kValueIndex), casted_stub()->is_js_array(), | 662 GetParameter(StoreDescriptor::kValueIndex), casted_stub()->is_js_array(), |
663 casted_stub()->elements_kind(), STORE, NEVER_RETURN_HOLE, | 663 casted_stub()->elements_kind(), STORE, NEVER_RETURN_HOLE, |
664 casted_stub()->store_mode()); | 664 casted_stub()->store_mode()); |
665 | 665 |
666 return GetParameter(2); | 666 return GetParameter(2); |
667 } | 667 } |
668 | 668 |
669 | 669 |
670 Handle<Code> StoreFastElementStub::GenerateCode() { | 670 Handle<Code> StoreFastElementStub::GenerateCode() { |
671 return DoGenerateCode(this); | 671 return DoGenerateCode(this); |
672 } | 672 } |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 | 1094 |
1095 | 1095 |
1096 template <> | 1096 template <> |
1097 HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() { | 1097 HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() { |
1098 StoreGlobalStub* stub = casted_stub(); | 1098 StoreGlobalStub* stub = casted_stub(); |
1099 Handle<Object> hole(isolate()->heap()->the_hole_value(), isolate()); | 1099 Handle<Object> hole(isolate()->heap()->the_hole_value(), isolate()); |
1100 Handle<Object> placeholer_value(Smi::FromInt(0), isolate()); | 1100 Handle<Object> placeholer_value(Smi::FromInt(0), isolate()); |
1101 Handle<PropertyCell> placeholder_cell = | 1101 Handle<PropertyCell> placeholder_cell = |
1102 isolate()->factory()->NewPropertyCell(placeholer_value); | 1102 isolate()->factory()->NewPropertyCell(placeholer_value); |
1103 | 1103 |
1104 HParameter* value = GetParameter(StoreConvention::kValueIndex); | 1104 HParameter* value = GetParameter(StoreDescriptor::kValueIndex); |
1105 | 1105 |
1106 if (stub->check_global()) { | 1106 if (stub->check_global()) { |
1107 // Check that the map of the global has not changed: use a placeholder map | 1107 // Check that the map of the global has not changed: use a placeholder map |
1108 // that will be replaced later with the global object's map. | 1108 // that will be replaced later with the global object's map. |
1109 Handle<Map> placeholder_map = isolate()->factory()->meta_map(); | 1109 Handle<Map> placeholder_map = isolate()->factory()->meta_map(); |
1110 HValue* global = Add<HConstant>( | 1110 HValue* global = Add<HConstant>( |
1111 StoreGlobalStub::global_placeholder(isolate())); | 1111 StoreGlobalStub::global_placeholder(isolate())); |
1112 Add<HCheckMaps>(global, placeholder_map); | 1112 Add<HCheckMaps>(global, placeholder_map); |
1113 } | 1113 } |
1114 | 1114 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 } | 1440 } |
1441 | 1441 |
1442 | 1442 |
1443 Handle<Code> FastNewContextStub::GenerateCode() { | 1443 Handle<Code> FastNewContextStub::GenerateCode() { |
1444 return DoGenerateCode(this); | 1444 return DoGenerateCode(this); |
1445 } | 1445 } |
1446 | 1446 |
1447 | 1447 |
1448 template <> | 1448 template <> |
1449 HValue* CodeStubGraphBuilder<LoadDictionaryElementStub>::BuildCodeStub() { | 1449 HValue* CodeStubGraphBuilder<LoadDictionaryElementStub>::BuildCodeStub() { |
1450 HValue* receiver = GetParameter(LoadConvention::kReceiverIndex); | 1450 HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex); |
1451 HValue* key = GetParameter(LoadConvention::kNameIndex); | 1451 HValue* key = GetParameter(LoadDescriptor::kNameIndex); |
1452 | 1452 |
1453 Add<HCheckSmi>(key); | 1453 Add<HCheckSmi>(key); |
1454 | 1454 |
1455 HValue* elements = AddLoadElements(receiver); | 1455 HValue* elements = AddLoadElements(receiver); |
1456 | 1456 |
1457 HValue* hash = BuildElementIndexHash(key); | 1457 HValue* hash = BuildElementIndexHash(key); |
1458 | 1458 |
1459 return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash); | 1459 return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash); |
1460 } | 1460 } |
1461 | 1461 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 BuildElementsKindLimitCheck(if_builder, bit_field2, kind); | 1561 BuildElementsKindLimitCheck(if_builder, bit_field2, kind); |
1562 | 1562 |
1563 Push(BuildUncheckedMonomorphicElementAccess(receiver, key, NULL, | 1563 Push(BuildUncheckedMonomorphicElementAccess(receiver, key, NULL, |
1564 false, kind, | 1564 false, kind, |
1565 LOAD, NEVER_RETURN_HOLE, | 1565 LOAD, NEVER_RETURN_HOLE, |
1566 STANDARD_STORE)); | 1566 STANDARD_STORE)); |
1567 } | 1567 } |
1568 | 1568 |
1569 | 1569 |
1570 HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildCodeStub() { | 1570 HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildCodeStub() { |
1571 HValue* receiver = GetParameter(LoadConvention::kReceiverIndex); | 1571 HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex); |
1572 HValue* key = GetParameter(LoadConvention::kNameIndex); | 1572 HValue* key = GetParameter(LoadDescriptor::kNameIndex); |
1573 | 1573 |
1574 // Split into a smi/integer case and unique string case. | 1574 // Split into a smi/integer case and unique string case. |
1575 HIfContinuation index_name_split_continuation(graph()->CreateBasicBlock(), | 1575 HIfContinuation index_name_split_continuation(graph()->CreateBasicBlock(), |
1576 graph()->CreateBasicBlock()); | 1576 graph()->CreateBasicBlock()); |
1577 | 1577 |
1578 BuildKeyedIndexCheck(key, &index_name_split_continuation); | 1578 BuildKeyedIndexCheck(key, &index_name_split_continuation); |
1579 | 1579 |
1580 IfBuilder index_name_split(this, &index_name_split_continuation); | 1580 IfBuilder index_name_split(this, &index_name_split_continuation); |
1581 index_name_split.Then(); | 1581 index_name_split.Then(); |
1582 { | 1582 { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 } | 1785 } |
1786 | 1786 |
1787 | 1787 |
1788 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 1788 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
1789 return DoGenerateCode(this); | 1789 return DoGenerateCode(this); |
1790 } | 1790 } |
1791 | 1791 |
1792 | 1792 |
1793 template <> | 1793 template <> |
1794 HValue* CodeStubGraphBuilder<VectorLoadStub>::BuildCodeStub() { | 1794 HValue* CodeStubGraphBuilder<VectorLoadStub>::BuildCodeStub() { |
1795 HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex); | 1795 HValue* receiver = GetParameter(VectorLoadICDescriptor::kReceiverIndex); |
1796 Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER); | 1796 Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER); |
1797 return receiver; | 1797 return receiver; |
1798 } | 1798 } |
1799 | 1799 |
1800 | 1800 |
1801 Handle<Code> VectorLoadStub::GenerateCode() { return DoGenerateCode(this); } | 1801 Handle<Code> VectorLoadStub::GenerateCode() { return DoGenerateCode(this); } |
1802 | 1802 |
1803 | 1803 |
1804 template <> | 1804 template <> |
1805 HValue* CodeStubGraphBuilder<VectorKeyedLoadStub>::BuildCodeStub() { | 1805 HValue* CodeStubGraphBuilder<VectorKeyedLoadStub>::BuildCodeStub() { |
1806 HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex); | 1806 HValue* receiver = GetParameter(VectorLoadICDescriptor::kReceiverIndex); |
1807 Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER); | 1807 Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER); |
1808 return receiver; | 1808 return receiver; |
1809 } | 1809 } |
1810 | 1810 |
1811 | 1811 |
1812 Handle<Code> VectorKeyedLoadStub::GenerateCode() { | 1812 Handle<Code> VectorKeyedLoadStub::GenerateCode() { |
1813 return DoGenerateCode(this); | 1813 return DoGenerateCode(this); |
1814 } | 1814 } |
1815 } } // namespace v8::internal | 1815 } } // namespace v8::internal |
OLD | NEW |