| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset); | 267 return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset); |
| 268 } | 268 } |
| 269 | 269 |
| 270 | 270 |
| 271 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { | 271 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { |
| 272 return raw_assembler_->Load(kMachAnyTagged, object, | 272 return raw_assembler_->Load(kMachAnyTagged, object, |
| 273 IntPtrConstant(offset - kHeapObjectTag)); | 273 IntPtrConstant(offset - kHeapObjectTag)); |
| 274 } | 274 } |
| 275 | 275 |
| 276 | 276 |
| 277 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { | 277 Node* InterpreterAssembler::LoadContextSlot(Node* context, Node* slot_index) { |
| 278 return raw_assembler_->Load(kMachAnyTagged, context, | 278 Node* offset = |
| 279 IntPtrConstant(Context::SlotOffset(slot_index))); | 279 IntPtrAdd(WordShl(slot_index, kPointerSizeLog2), |
| 280 Int32Constant(Context::kHeaderSize - kHeapObjectTag)); |
| 281 return raw_assembler_->Load(kMachAnyTagged, context, offset); |
| 280 } | 282 } |
| 281 | 283 |
| 282 | 284 |
| 283 Node* InterpreterAssembler::LoadContextSlot(int slot_index) { | |
| 284 return LoadContextSlot(ContextTaggedPointer(), slot_index); | |
| 285 } | |
| 286 | |
| 287 | |
| 288 Node* InterpreterAssembler::LoadTypeFeedbackVector() { | 285 Node* InterpreterAssembler::LoadTypeFeedbackVector() { |
| 289 Node* function = raw_assembler_->Load( | 286 Node* function = raw_assembler_->Load( |
| 290 kMachAnyTagged, RegisterFileRawPointer(), | 287 kMachAnyTagged, RegisterFileRawPointer(), |
| 291 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer)); | 288 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer)); |
| 292 Node* shared_info = | 289 Node* shared_info = |
| 293 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); | 290 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); |
| 294 Node* vector = | 291 Node* vector = |
| 295 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); | 292 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); |
| 296 return vector; | 293 return vector; |
| 297 } | 294 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 return raw_assembler_->schedule(); | 502 return raw_assembler_->schedule(); |
| 506 } | 503 } |
| 507 | 504 |
| 508 | 505 |
| 509 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 506 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
| 510 | 507 |
| 511 | 508 |
| 512 } // namespace interpreter | 509 } // namespace interpreter |
| 513 } // namespace internal | 510 } // namespace internal |
| 514 } // namespace v8 | 511 } // namespace v8 |
| OLD | NEW |