| 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 // And finally update the map. | 545 // And finally update the map. |
| 546 assembler->StoreObjectField(receiver, JSObject::kMapOffset, map); | 546 assembler->StoreObjectField(receiver, JSObject::kMapOffset, map); |
| 547 break; | 547 break; |
| 548 } | 548 } |
| 549 assembler->Return(value); | 549 assembler->Return(value); |
| 550 | 550 |
| 551 if (needs_miss_case) { | 551 if (needs_miss_case) { |
| 552 assembler->Bind(&miss); | 552 assembler->Bind(&miss); |
| 553 { | 553 { |
| 554 assembler->Comment("Miss"); | 554 assembler->Comment("Miss"); |
| 555 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, receiver, | 555 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, |
| 556 name, value, slot, vector); | 556 vector, receiver, name); |
| 557 } | 557 } |
| 558 } | 558 } |
| 559 } | 559 } |
| 560 | 560 |
| 561 void ElementsTransitionAndStoreStub::GenerateAssembly( | 561 void ElementsTransitionAndStoreStub::GenerateAssembly( |
| 562 CodeStubAssembler* assembler) const { | 562 CodeStubAssembler* assembler) const { |
| 563 typedef CodeStubAssembler::Label Label; | 563 typedef CodeStubAssembler::Label Label; |
| 564 typedef compiler::Node Node; | 564 typedef compiler::Node Node; |
| 565 | 565 |
| 566 Node* receiver = assembler->Parameter(Descriptor::kReceiver); | 566 Node* receiver = assembler->Parameter(Descriptor::kReceiver); |
| (...skipping 3992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4559 assembler->PrepareValueForWrite(value, representation, &miss); | 4559 assembler->PrepareValueForWrite(value, representation, &miss); |
| 4560 assembler->StoreNamedField(receiver, index, representation, prepared_value, | 4560 assembler->StoreNamedField(receiver, index, representation, prepared_value, |
| 4561 false); | 4561 false); |
| 4562 assembler->Return(value); | 4562 assembler->Return(value); |
| 4563 | 4563 |
| 4564 // Only stores to tagged field can't bailout. | 4564 // Only stores to tagged field can't bailout. |
| 4565 if (!representation.IsTagged()) { | 4565 if (!representation.IsTagged()) { |
| 4566 assembler->Bind(&miss); | 4566 assembler->Bind(&miss); |
| 4567 { | 4567 { |
| 4568 assembler->Comment("Miss"); | 4568 assembler->Comment("Miss"); |
| 4569 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, receiver, | 4569 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, |
| 4570 name, value, slot, vector); | 4570 vector, receiver, name); |
| 4571 } | 4571 } |
| 4572 } | 4572 } |
| 4573 } | 4573 } |
| 4574 | 4574 |
| 4575 void StoreGlobalStub::GenerateAssembly(CodeStubAssembler* assembler) const { | 4575 void StoreGlobalStub::GenerateAssembly(CodeStubAssembler* assembler) const { |
| 4576 typedef CodeStubAssembler::Label Label; | 4576 typedef CodeStubAssembler::Label Label; |
| 4577 typedef compiler::Node Node; | 4577 typedef compiler::Node Node; |
| 4578 | 4578 |
| 4579 assembler->Comment( | 4579 assembler->Comment( |
| 4580 "StoreGlobalStub: cell_type=%d, constant_type=%d, check_global=%d", | 4580 "StoreGlobalStub: cell_type=%d, constant_type=%d, check_global=%d", |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4655 } else { | 4655 } else { |
| 4656 assembler->StoreObjectField(cell, PropertyCell::kValueOffset, value); | 4656 assembler->StoreObjectField(cell, PropertyCell::kValueOffset, value); |
| 4657 } | 4657 } |
| 4658 } | 4658 } |
| 4659 | 4659 |
| 4660 assembler->Return(value); | 4660 assembler->Return(value); |
| 4661 | 4661 |
| 4662 assembler->Bind(&miss); | 4662 assembler->Bind(&miss); |
| 4663 { | 4663 { |
| 4664 assembler->Comment("Miss"); | 4664 assembler->Comment("Miss"); |
| 4665 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, receiver, name, | 4665 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, |
| 4666 value, slot, vector); | 4666 vector, receiver, name); |
| 4667 } | 4667 } |
| 4668 } | 4668 } |
| 4669 | 4669 |
| 4670 void KeyedLoadSloppyArgumentsStub::GenerateAssembly( | 4670 void KeyedLoadSloppyArgumentsStub::GenerateAssembly( |
| 4671 CodeStubAssembler* assembler) const { | 4671 CodeStubAssembler* assembler) const { |
| 4672 typedef CodeStubAssembler::Label Label; | 4672 typedef CodeStubAssembler::Label Label; |
| 4673 typedef compiler::Node Node; | 4673 typedef compiler::Node Node; |
| 4674 | 4674 |
| 4675 Node* receiver = assembler->Parameter(Descriptor::kReceiver); | 4675 Node* receiver = assembler->Parameter(Descriptor::kReceiver); |
| 4676 Node* key = assembler->Parameter(Descriptor::kName); | 4676 Node* key = assembler->Parameter(Descriptor::kName); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 4704 Node* context = assembler->Parameter(Descriptor::kContext); | 4704 Node* context = assembler->Parameter(Descriptor::kContext); |
| 4705 | 4705 |
| 4706 Label miss(assembler); | 4706 Label miss(assembler); |
| 4707 | 4707 |
| 4708 assembler->StoreKeyedSloppyArguments(receiver, key, value, &miss); | 4708 assembler->StoreKeyedSloppyArguments(receiver, key, value, &miss); |
| 4709 assembler->Return(value); | 4709 assembler->Return(value); |
| 4710 | 4710 |
| 4711 assembler->Bind(&miss); | 4711 assembler->Bind(&miss); |
| 4712 { | 4712 { |
| 4713 assembler->Comment("Miss"); | 4713 assembler->Comment("Miss"); |
| 4714 assembler->TailCallRuntime(Runtime::kKeyedStoreIC_Miss, context, receiver, | 4714 assembler->TailCallRuntime(Runtime::kKeyedStoreIC_Miss, context, value, |
| 4715 key, value, slot, vector); | 4715 slot, vector, receiver, key); |
| 4716 } | 4716 } |
| 4717 } | 4717 } |
| 4718 | 4718 |
| 4719 void LoadScriptContextFieldStub::GenerateAssembly( | 4719 void LoadScriptContextFieldStub::GenerateAssembly( |
| 4720 CodeStubAssembler* assembler) const { | 4720 CodeStubAssembler* assembler) const { |
| 4721 typedef compiler::Node Node; | 4721 typedef compiler::Node Node; |
| 4722 | 4722 |
| 4723 assembler->Comment("LoadScriptContextFieldStub: context_index=%d, slot=%d", | 4723 assembler->Comment("LoadScriptContextFieldStub: context_index=%d, slot=%d", |
| 4724 context_index(), slot_index()); | 4724 context_index(), slot_index()); |
| 4725 | 4725 |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5781 | 5781 |
| 5782 Label miss(assembler); | 5782 Label miss(assembler); |
| 5783 | 5783 |
| 5784 assembler->EmitElementStore(receiver, key, value, is_js_array(), | 5784 assembler->EmitElementStore(receiver, key, value, is_js_array(), |
| 5785 elements_kind(), store_mode(), &miss); | 5785 elements_kind(), store_mode(), &miss); |
| 5786 assembler->Return(value); | 5786 assembler->Return(value); |
| 5787 | 5787 |
| 5788 assembler->Bind(&miss); | 5788 assembler->Bind(&miss); |
| 5789 { | 5789 { |
| 5790 assembler->Comment("Miss"); | 5790 assembler->Comment("Miss"); |
| 5791 assembler->TailCallRuntime(Runtime::kKeyedStoreIC_Miss, context, receiver, | 5791 assembler->TailCallRuntime(Runtime::kKeyedStoreIC_Miss, context, value, |
| 5792 key, value, slot, vector); | 5792 slot, vector, receiver, key); |
| 5793 } | 5793 } |
| 5794 } | 5794 } |
| 5795 | 5795 |
| 5796 // static | 5796 // static |
| 5797 void StoreFastElementStub::GenerateAheadOfTime(Isolate* isolate) { | 5797 void StoreFastElementStub::GenerateAheadOfTime(Isolate* isolate) { |
| 5798 if (FLAG_minimal) return; | 5798 if (FLAG_minimal) return; |
| 5799 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, STANDARD_STORE) | 5799 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, STANDARD_STORE) |
| 5800 .GetCode(); | 5800 .GetCode(); |
| 5801 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, | 5801 StoreFastElementStub(isolate, false, FAST_HOLEY_ELEMENTS, |
| 5802 STORE_AND_GROW_NO_TRANSITION).GetCode(); | 5802 STORE_AND_GROW_NO_TRANSITION).GetCode(); |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6124 | 6124 |
| 6125 if (type == MachineType::Pointer()) { | 6125 if (type == MachineType::Pointer()) { |
| 6126 return Representation::External(); | 6126 return Representation::External(); |
| 6127 } | 6127 } |
| 6128 | 6128 |
| 6129 return Representation::Tagged(); | 6129 return Representation::Tagged(); |
| 6130 } | 6130 } |
| 6131 | 6131 |
| 6132 } // namespace internal | 6132 } // namespace internal |
| 6133 } // namespace v8 | 6133 } // namespace v8 |
| OLD | NEW |