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 4597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4608 assembler->Return(value); | 4608 assembler->Return(value); |
4609 | 4609 |
4610 assembler->Bind(&miss); | 4610 assembler->Bind(&miss); |
4611 { | 4611 { |
4612 assembler->Comment("Miss"); | 4612 assembler->Comment("Miss"); |
4613 assembler->TailCallRuntime(Runtime::kKeyedStoreIC_Miss, context, receiver, | 4613 assembler->TailCallRuntime(Runtime::kKeyedStoreIC_Miss, context, receiver, |
4614 key, value, slot, vector); | 4614 key, value, slot, vector); |
4615 } | 4615 } |
4616 } | 4616 } |
4617 | 4617 |
| 4618 void LoadScriptContextFieldStub::GenerateAssembly( |
| 4619 CodeStubAssembler* assembler) const { |
| 4620 typedef compiler::Node Node; |
| 4621 |
| 4622 assembler->Comment("LoadScriptContextFieldStub: context_index=%d, slot=%d", |
| 4623 context_index(), slot_index()); |
| 4624 |
| 4625 Node* context = assembler->Parameter(Descriptor::kContext); |
| 4626 |
| 4627 Node* script_context = assembler->LoadScriptContext(context, context_index()); |
| 4628 Node* result = assembler->LoadFixedArrayElement( |
| 4629 script_context, assembler->IntPtrConstant(slot_index()), 0, |
| 4630 CodeStubAssembler::INTPTR_PARAMETERS); |
| 4631 assembler->Return(result); |
| 4632 } |
| 4633 |
| 4634 void StoreScriptContextFieldStub::GenerateAssembly( |
| 4635 CodeStubAssembler* assembler) const { |
| 4636 typedef compiler::Node Node; |
| 4637 |
| 4638 assembler->Comment("StoreScriptContextFieldStub: context_index=%d, slot=%d", |
| 4639 context_index(), slot_index()); |
| 4640 |
| 4641 Node* value = assembler->Parameter(Descriptor::kValue); |
| 4642 Node* context = assembler->Parameter(Descriptor::kContext); |
| 4643 |
| 4644 Node* script_context = assembler->LoadScriptContext(context, context_index()); |
| 4645 assembler->StoreFixedArrayElement( |
| 4646 script_context, assembler->IntPtrConstant(slot_index()), value, |
| 4647 UPDATE_WRITE_BARRIER, CodeStubAssembler::INTPTR_PARAMETERS); |
| 4648 assembler->Return(value); |
| 4649 } |
| 4650 |
4618 // static | 4651 // static |
4619 compiler::Node* LessThanStub::Generate(CodeStubAssembler* assembler, | 4652 compiler::Node* LessThanStub::Generate(CodeStubAssembler* assembler, |
4620 compiler::Node* lhs, compiler::Node* rhs, | 4653 compiler::Node* lhs, compiler::Node* rhs, |
4621 compiler::Node* context) { | 4654 compiler::Node* context) { |
4622 return GenerateAbstractRelationalComparison(assembler, kLessThan, lhs, rhs, | 4655 return GenerateAbstractRelationalComparison(assembler, kLessThan, lhs, rhs, |
4623 context); | 4656 context); |
4624 } | 4657 } |
4625 | 4658 |
4626 // static | 4659 // static |
4627 compiler::Node* LessThanOrEqualStub::Generate(CodeStubAssembler* assembler, | 4660 compiler::Node* LessThanOrEqualStub::Generate(CodeStubAssembler* assembler, |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6028 | 6061 |
6029 if (type == MachineType::Pointer()) { | 6062 if (type == MachineType::Pointer()) { |
6030 return Representation::External(); | 6063 return Representation::External(); |
6031 } | 6064 } |
6032 | 6065 |
6033 return Representation::Tagged(); | 6066 return Representation::Tagged(); |
6034 } | 6067 } |
6035 | 6068 |
6036 } // namespace internal | 6069 } // namespace internal |
6037 } // namespace v8 | 6070 } // namespace v8 |
OLD | NEW |