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/compiler/interpreter-assembler.h" | 5 #include "src/compiler/interpreter-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { | 284 Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { |
285 Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(), | 285 Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(), |
286 BytecodeArray::kConstantPoolOffset); | 286 BytecodeArray::kConstantPoolOffset); |
287 Node* entry_offset = | 287 Node* entry_offset = |
288 IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), | 288 IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), |
289 WordShl(index, kPointerSizeLog2)); | 289 WordShl(index, kPointerSizeLog2)); |
290 return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset); | 290 return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset); |
291 } | 291 } |
292 | 292 |
293 | 293 |
294 Node* InterpreterAssembler::LoadFixedArrayElement(Node* fixed_array, | |
rmcilroy
2015/10/26 14:04:01
nit - please add a test for this in interpreter-as
oth
2015/10/28 11:53:11
Done.
| |
295 int index) { | |
296 Node* entry_offset = | |
297 IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), | |
298 WordShl(Int32Constant(index), kPointerSizeLog2)); | |
299 return raw_assembler_->Load(kMachAnyTagged, fixed_array, entry_offset); | |
300 } | |
301 | |
302 | |
294 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { | 303 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { |
295 return raw_assembler_->Load(kMachAnyTagged, object, | 304 return raw_assembler_->Load(kMachAnyTagged, object, |
296 IntPtrConstant(offset - kHeapObjectTag)); | 305 IntPtrConstant(offset - kHeapObjectTag)); |
297 } | 306 } |
298 | 307 |
299 | 308 |
300 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { | 309 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { |
301 return raw_assembler_->Load(kMachAnyTagged, context, | 310 return raw_assembler_->Load(kMachAnyTagged, context, |
302 IntPtrConstant(Context::SlotOffset(slot_index))); | 311 IntPtrConstant(Context::SlotOffset(slot_index))); |
303 } | 312 } |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 return raw_assembler_->schedule(); | 635 return raw_assembler_->schedule(); |
627 } | 636 } |
628 | 637 |
629 | 638 |
630 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 639 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
631 | 640 |
632 | 641 |
633 } // namespace compiler | 642 } // namespace compiler |
634 } // namespace internal | 643 } // namespace internal |
635 } // namespace v8 | 644 } // namespace v8 |
OLD | NEW |