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/code-stub-assembler.h" | 5 #include "src/compiler/code-stub-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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 MachineType rep) { | 429 MachineType rep) { |
430 return raw_assembler_->Load(rep, buffer, IntPtrConstant(offset)); | 430 return raw_assembler_->Load(rep, buffer, IntPtrConstant(offset)); |
431 } | 431 } |
432 | 432 |
433 Node* CodeStubAssembler::LoadObjectField(Node* object, int offset, | 433 Node* CodeStubAssembler::LoadObjectField(Node* object, int offset, |
434 MachineType rep) { | 434 MachineType rep) { |
435 return raw_assembler_->Load(rep, object, | 435 return raw_assembler_->Load(rep, object, |
436 IntPtrConstant(offset - kHeapObjectTag)); | 436 IntPtrConstant(offset - kHeapObjectTag)); |
437 } | 437 } |
438 | 438 |
| 439 Node* CodeStubAssembler::StoreObjectFieldNoWriteBarrier( |
| 440 Node* object, int offset, Node* value, MachineRepresentation rep) { |
| 441 return StoreNoWriteBarrier(rep, object, |
| 442 IntPtrConstant(offset - kHeapObjectTag), value); |
| 443 } |
| 444 |
439 Node* CodeStubAssembler::LoadHeapNumberValue(Node* object) { | 445 Node* CodeStubAssembler::LoadHeapNumberValue(Node* object) { |
440 return Load(MachineType::Float64(), object, | 446 return Load(MachineType::Float64(), object, |
441 IntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag)); | 447 IntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag)); |
442 } | 448 } |
443 | 449 |
444 Node* CodeStubAssembler::StoreHeapNumberValue(Node* object, Node* value) { | 450 Node* CodeStubAssembler::StoreHeapNumberValue(Node* object, Node* value) { |
445 return StoreNoWriteBarrier( | 451 return StoreNoWriteBarrier( |
446 MachineRepresentation::kFloat64, object, | 452 MachineRepresentation::kFloat64, object, |
447 IntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag), value); | 453 IntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag), value); |
448 } | 454 } |
449 | 455 |
450 Node* CodeStubAssembler::TruncateHeapNumberValueToWord32(Node* object) { | 456 Node* CodeStubAssembler::TruncateHeapNumberValueToWord32(Node* object) { |
451 Node* value = LoadHeapNumberValue(object); | 457 Node* value = LoadHeapNumberValue(object); |
452 return raw_assembler_->TruncateFloat64ToInt32(TruncationMode::kJavaScript, | 458 return raw_assembler_->TruncateFloat64ToInt32(TruncationMode::kJavaScript, |
453 value); | 459 value); |
454 } | 460 } |
455 | 461 |
456 Node* CodeStubAssembler::LoadMapBitField(Node* map) { | 462 Node* CodeStubAssembler::LoadMapBitField(Node* map) { |
457 return Load(MachineType::Uint8(), map, | 463 return Load(MachineType::Uint8(), map, |
458 IntPtrConstant(Map::kBitFieldOffset - kHeapObjectTag)); | 464 IntPtrConstant(Map::kBitFieldOffset - kHeapObjectTag)); |
459 } | 465 } |
460 | 466 |
461 Node* CodeStubAssembler::LoadMapInstanceType(Node* map) { | 467 Node* CodeStubAssembler::LoadMapInstanceType(Node* map) { |
462 return Load(MachineType::Uint8(), map, | 468 return Load(MachineType::Uint8(), map, |
463 IntPtrConstant(Map::kInstanceTypeOffset - kHeapObjectTag)); | 469 IntPtrConstant(Map::kInstanceTypeOffset - kHeapObjectTag)); |
464 } | 470 } |
465 | 471 |
| 472 Node* CodeStubAssembler::LoadMapInstanceSize(Node* map) { |
| 473 return Load(MachineType::Uint8(), map, |
| 474 IntPtrConstant(Map::kInstanceSizeOffset - kHeapObjectTag)); |
| 475 } |
| 476 |
466 Node* CodeStubAssembler::LoadFixedArrayElementSmiIndex(Node* object, | 477 Node* CodeStubAssembler::LoadFixedArrayElementSmiIndex(Node* object, |
467 Node* smi_index, | 478 Node* smi_index, |
468 int additional_offset) { | 479 int additional_offset) { |
469 int const kSmiShiftBits = kSmiShiftSize + kSmiTagSize; | 480 int const kSmiShiftBits = kSmiShiftSize + kSmiTagSize; |
470 Node* header_size = IntPtrConstant(additional_offset + | 481 Node* header_size = IntPtrConstant(additional_offset + |
471 FixedArray::kHeaderSize - kHeapObjectTag); | 482 FixedArray::kHeaderSize - kHeapObjectTag); |
472 Node* scaled_index = | 483 Node* scaled_index = |
473 (kSmiShiftBits > kPointerSizeLog2) | 484 (kSmiShiftBits > kPointerSizeLog2) |
474 ? WordSar(smi_index, IntPtrConstant(kSmiShiftBits - kPointerSizeLog2)) | 485 ? WordSar(smi_index, IntPtrConstant(kSmiShiftBits - kPointerSizeLog2)) |
475 : WordShl(smi_index, | 486 : WordShl(smi_index, |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 } | 1319 } |
1309 } | 1320 } |
1310 } | 1321 } |
1311 | 1322 |
1312 bound_ = true; | 1323 bound_ = true; |
1313 } | 1324 } |
1314 | 1325 |
1315 } // namespace compiler | 1326 } // namespace compiler |
1316 } // namespace internal | 1327 } // namespace internal |
1317 } // namespace v8 | 1328 } // namespace v8 |
OLD | NEW |