| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/interpreter-assembler.h" | 5 #include "src/interpreter/interpreter-assembler.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 | 9 |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { | 365 Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { |
| 366 Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(), | 366 Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(), |
| 367 BytecodeArray::kConstantPoolOffset); | 367 BytecodeArray::kConstantPoolOffset); |
| 368 Node* entry_offset = | 368 Node* entry_offset = |
| 369 IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), | 369 IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), |
| 370 WordShl(index, kPointerSizeLog2)); | 370 WordShl(index, kPointerSizeLog2)); |
| 371 return Load(MachineType::AnyTagged(), constant_pool, entry_offset); | 371 return Load(MachineType::AnyTagged(), constant_pool, entry_offset); |
| 372 } | 372 } |
| 373 | 373 |
| 374 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { | |
| 375 return Load(MachineType::AnyTagged(), object, | |
| 376 IntPtrConstant(offset - kHeapObjectTag)); | |
| 377 } | |
| 378 | |
| 379 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { | 374 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { |
| 380 return Load(MachineType::AnyTagged(), context, | 375 return Load(MachineType::AnyTagged(), context, |
| 381 IntPtrConstant(Context::SlotOffset(slot_index))); | 376 IntPtrConstant(Context::SlotOffset(slot_index))); |
| 382 } | 377 } |
| 383 | 378 |
| 384 Node* InterpreterAssembler::LoadContextSlot(Node* context, Node* slot_index) { | 379 Node* InterpreterAssembler::LoadContextSlot(Node* context, Node* slot_index) { |
| 385 Node* offset = | 380 Node* offset = |
| 386 IntPtrAdd(WordShl(slot_index, kPointerSizeLog2), | 381 IntPtrAdd(WordShl(slot_index, kPointerSizeLog2), |
| 387 IntPtrConstant(Context::kHeaderSize - kHeapObjectTag)); | 382 IntPtrConstant(Context::kHeaderSize - kHeapObjectTag)); |
| 388 return Load(MachineType::AnyTagged(), context, offset); | 383 return Load(MachineType::AnyTagged(), context, offset); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 V8_TARGET_ARCH_S390 | 704 V8_TARGET_ARCH_S390 |
| 710 return true; | 705 return true; |
| 711 #else | 706 #else |
| 712 #error "Unknown Architecture" | 707 #error "Unknown Architecture" |
| 713 #endif | 708 #endif |
| 714 } | 709 } |
| 715 | 710 |
| 716 } // namespace interpreter | 711 } // namespace interpreter |
| 717 } // namespace internal | 712 } // namespace internal |
| 718 } // namespace v8 | 713 } // namespace v8 |
| OLD | NEW |