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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 Node* InterpreterAssembler::HeapConstant(Handle<HeapObject> object) { | 245 Node* InterpreterAssembler::HeapConstant(Handle<HeapObject> object) { |
246 return raw_assembler_->HeapConstant(object); | 246 return raw_assembler_->HeapConstant(object); |
247 } | 247 } |
248 | 248 |
249 | 249 |
250 Node* InterpreterAssembler::BooleanConstant(bool value) { | 250 Node* InterpreterAssembler::BooleanConstant(bool value) { |
251 return raw_assembler_->BooleanConstant(value); | 251 return raw_assembler_->BooleanConstant(value); |
252 } | 252 } |
253 | 253 |
254 | 254 |
| 255 Node* InterpreterAssembler::NullConstant() { |
| 256 return raw_assembler_->NullConstant(); |
| 257 } |
| 258 |
| 259 |
| 260 Node* InterpreterAssembler::UndefinedConstant() { |
| 261 return raw_assembler_->UndefinedConstant(); |
| 262 } |
| 263 |
| 264 |
255 Node* InterpreterAssembler::SmiShiftBitsConstant() { | 265 Node* InterpreterAssembler::SmiShiftBitsConstant() { |
256 return Int32Constant(kSmiShiftSize + kSmiTagSize); | 266 return Int32Constant(kSmiShiftSize + kSmiTagSize); |
257 } | 267 } |
258 | 268 |
259 | 269 |
260 Node* InterpreterAssembler::SmiTag(Node* value) { | 270 Node* InterpreterAssembler::SmiTag(Node* value) { |
261 return raw_assembler_->WordShl(value, SmiShiftBitsConstant()); | 271 return raw_assembler_->WordShl(value, SmiShiftBitsConstant()); |
262 } | 272 } |
263 | 273 |
264 | 274 |
(...skipping 20 matching lines...) Expand all Loading... |
285 Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { | 295 Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { |
286 Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(), | 296 Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(), |
287 BytecodeArray::kConstantPoolOffset); | 297 BytecodeArray::kConstantPoolOffset); |
288 Node* entry_offset = | 298 Node* entry_offset = |
289 IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), | 299 IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), |
290 WordShl(index, kPointerSizeLog2)); | 300 WordShl(index, kPointerSizeLog2)); |
291 return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset); | 301 return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset); |
292 } | 302 } |
293 | 303 |
294 | 304 |
| 305 Node* InterpreterAssembler::LoadFixedArrayElement(Node* fixed_array, |
| 306 int index) { |
| 307 Node* entry_offset = |
| 308 IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), |
| 309 WordShl(Int32Constant(index), kPointerSizeLog2)); |
| 310 return raw_assembler_->Load(kMachAnyTagged, fixed_array, entry_offset); |
| 311 } |
| 312 |
| 313 |
295 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { | 314 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { |
296 return raw_assembler_->Load(kMachAnyTagged, object, | 315 return raw_assembler_->Load(kMachAnyTagged, object, |
297 IntPtrConstant(offset - kHeapObjectTag)); | 316 IntPtrConstant(offset - kHeapObjectTag)); |
298 } | 317 } |
299 | 318 |
300 | 319 |
301 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { | 320 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { |
302 return raw_assembler_->Load(kMachAnyTagged, context, | 321 return raw_assembler_->Load(kMachAnyTagged, context, |
303 IntPtrConstant(Context::SlotOffset(slot_index))); | 322 IntPtrConstant(Context::SlotOffset(slot_index))); |
304 } | 323 } |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 return raw_assembler_->schedule(); | 648 return raw_assembler_->schedule(); |
630 } | 649 } |
631 | 650 |
632 | 651 |
633 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 652 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
634 | 653 |
635 | 654 |
636 } // namespace compiler | 655 } // namespace compiler |
637 } // namespace internal | 656 } // namespace internal |
638 } // namespace v8 | 657 } // namespace v8 |
OLD | NEW |