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(KeyedLoadIC::kReceiverIndex), | 545 GetParameter(LoadConvention::kReceiverIndex), |
546 GetParameter(KeyedLoadIC::kNameIndex), | 546 GetParameter(LoadConvention::kNameIndex), NULL, |
547 NULL, | 547 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, |
548 casted_stub()->is_js_array(), | 548 NEVER_RETURN_HOLE, STANDARD_STORE); |
549 casted_stub()->elements_kind(), | |
550 LOAD, | |
551 NEVER_RETURN_HOLE, | |
552 STANDARD_STORE); | |
553 return load; | 549 return load; |
554 } | 550 } |
555 | 551 |
556 | 552 |
557 Handle<Code> LoadFastElementStub::GenerateCode() { | 553 Handle<Code> LoadFastElementStub::GenerateCode() { |
558 return DoGenerateCode(this); | 554 return DoGenerateCode(this); |
559 } | 555 } |
560 | 556 |
561 | 557 |
562 HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField( | 558 HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField( |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 | 650 |
655 | 651 |
656 Handle<Code> StringLengthStub::GenerateCode() { | 652 Handle<Code> StringLengthStub::GenerateCode() { |
657 return DoGenerateCode(this); | 653 return DoGenerateCode(this); |
658 } | 654 } |
659 | 655 |
660 | 656 |
661 template <> | 657 template <> |
662 HValue* CodeStubGraphBuilder<StoreFastElementStub>::BuildCodeStub() { | 658 HValue* CodeStubGraphBuilder<StoreFastElementStub>::BuildCodeStub() { |
663 BuildUncheckedMonomorphicElementAccess( | 659 BuildUncheckedMonomorphicElementAccess( |
664 GetParameter(StoreIC::kReceiverIndex), | 660 GetParameter(StoreConvention::kReceiverIndex), |
665 GetParameter(StoreIC::kNameIndex), | 661 GetParameter(StoreConvention::kNameIndex), |
666 GetParameter(StoreIC::kValueIndex), | 662 GetParameter(StoreConvention::kValueIndex), casted_stub()->is_js_array(), |
667 casted_stub()->is_js_array(), casted_stub()->elements_kind(), | 663 casted_stub()->elements_kind(), STORE, NEVER_RETURN_HOLE, |
668 STORE, NEVER_RETURN_HOLE, casted_stub()->store_mode()); | 664 casted_stub()->store_mode()); |
669 | 665 |
670 return GetParameter(2); | 666 return GetParameter(2); |
671 } | 667 } |
672 | 668 |
673 | 669 |
674 Handle<Code> StoreFastElementStub::GenerateCode() { | 670 Handle<Code> StoreFastElementStub::GenerateCode() { |
675 return DoGenerateCode(this); | 671 return DoGenerateCode(this); |
676 } | 672 } |
677 | 673 |
678 | 674 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 | 1094 |
1099 | 1095 |
1100 template <> | 1096 template <> |
1101 HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() { | 1097 HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() { |
1102 StoreGlobalStub* stub = casted_stub(); | 1098 StoreGlobalStub* stub = casted_stub(); |
1103 Handle<Object> hole(isolate()->heap()->the_hole_value(), isolate()); | 1099 Handle<Object> hole(isolate()->heap()->the_hole_value(), isolate()); |
1104 Handle<Object> placeholer_value(Smi::FromInt(0), isolate()); | 1100 Handle<Object> placeholer_value(Smi::FromInt(0), isolate()); |
1105 Handle<PropertyCell> placeholder_cell = | 1101 Handle<PropertyCell> placeholder_cell = |
1106 isolate()->factory()->NewPropertyCell(placeholer_value); | 1102 isolate()->factory()->NewPropertyCell(placeholer_value); |
1107 | 1103 |
1108 HParameter* value = GetParameter(StoreIC::kValueIndex); | 1104 HParameter* value = GetParameter(StoreConvention::kValueIndex); |
1109 | 1105 |
1110 if (stub->check_global()) { | 1106 if (stub->check_global()) { |
1111 // 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 |
1112 // that will be replaced later with the global object's map. | 1108 // that will be replaced later with the global object's map. |
1113 Handle<Map> placeholder_map = isolate()->factory()->meta_map(); | 1109 Handle<Map> placeholder_map = isolate()->factory()->meta_map(); |
1114 HValue* global = Add<HConstant>( | 1110 HValue* global = Add<HConstant>( |
1115 StoreGlobalStub::global_placeholder(isolate())); | 1111 StoreGlobalStub::global_placeholder(isolate())); |
1116 Add<HCheckMaps>(global, placeholder_map); | 1112 Add<HCheckMaps>(global, placeholder_map); |
1117 } | 1113 } |
1118 | 1114 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 } | 1440 } |
1445 | 1441 |
1446 | 1442 |
1447 Handle<Code> FastNewContextStub::GenerateCode() { | 1443 Handle<Code> FastNewContextStub::GenerateCode() { |
1448 return DoGenerateCode(this); | 1444 return DoGenerateCode(this); |
1449 } | 1445 } |
1450 | 1446 |
1451 | 1447 |
1452 template <> | 1448 template <> |
1453 HValue* CodeStubGraphBuilder<LoadDictionaryElementStub>::BuildCodeStub() { | 1449 HValue* CodeStubGraphBuilder<LoadDictionaryElementStub>::BuildCodeStub() { |
1454 HValue* receiver = GetParameter(KeyedLoadIC::kReceiverIndex); | 1450 HValue* receiver = GetParameter(LoadConvention::kReceiverIndex); |
1455 HValue* key = GetParameter(KeyedLoadIC::kNameIndex); | 1451 HValue* key = GetParameter(LoadConvention::kNameIndex); |
1456 | 1452 |
1457 Add<HCheckSmi>(key); | 1453 Add<HCheckSmi>(key); |
1458 | 1454 |
1459 HValue* elements = AddLoadElements(receiver); | 1455 HValue* elements = AddLoadElements(receiver); |
1460 | 1456 |
1461 HValue* hash = BuildElementIndexHash(key); | 1457 HValue* hash = BuildElementIndexHash(key); |
1462 | 1458 |
1463 return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash); | 1459 return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash); |
1464 } | 1460 } |
1465 | 1461 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 BuildElementsKindLimitCheck(if_builder, bit_field2, kind); | 1561 BuildElementsKindLimitCheck(if_builder, bit_field2, kind); |
1566 | 1562 |
1567 Push(BuildUncheckedMonomorphicElementAccess(receiver, key, NULL, | 1563 Push(BuildUncheckedMonomorphicElementAccess(receiver, key, NULL, |
1568 false, kind, | 1564 false, kind, |
1569 LOAD, NEVER_RETURN_HOLE, | 1565 LOAD, NEVER_RETURN_HOLE, |
1570 STANDARD_STORE)); | 1566 STANDARD_STORE)); |
1571 } | 1567 } |
1572 | 1568 |
1573 | 1569 |
1574 HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildCodeStub() { | 1570 HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildCodeStub() { |
1575 HValue* receiver = GetParameter(KeyedLoadIC::kReceiverIndex); | 1571 HValue* receiver = GetParameter(LoadConvention::kReceiverIndex); |
1576 HValue* key = GetParameter(KeyedLoadIC::kNameIndex); | 1572 HValue* key = GetParameter(LoadConvention::kNameIndex); |
1577 | 1573 |
1578 // Split into a smi/integer case and unique string case. | 1574 // Split into a smi/integer case and unique string case. |
1579 HIfContinuation index_name_split_continuation(graph()->CreateBasicBlock(), | 1575 HIfContinuation index_name_split_continuation(graph()->CreateBasicBlock(), |
1580 graph()->CreateBasicBlock()); | 1576 graph()->CreateBasicBlock()); |
1581 | 1577 |
1582 BuildKeyedIndexCheck(key, &index_name_split_continuation); | 1578 BuildKeyedIndexCheck(key, &index_name_split_continuation); |
1583 | 1579 |
1584 IfBuilder index_name_split(this, &index_name_split_continuation); | 1580 IfBuilder index_name_split(this, &index_name_split_continuation); |
1585 index_name_split.Then(); | 1581 index_name_split.Then(); |
1586 { | 1582 { |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 return Pop(); | 1784 return Pop(); |
1789 } | 1785 } |
1790 | 1786 |
1791 | 1787 |
1792 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 1788 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
1793 return DoGenerateCode(this); | 1789 return DoGenerateCode(this); |
1794 } | 1790 } |
1795 | 1791 |
1796 | 1792 |
1797 } } // namespace v8::internal | 1793 } } // namespace v8::internal |
OLD | NEW |