Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 } | 119 } |
| 120 | 120 |
| 121 // Memory Operations. | 121 // Memory Operations. |
| 122 Node* Load(MachineType rep, Node* base) { | 122 Node* Load(MachineType rep, Node* base) { |
| 123 return Load(rep, base, IntPtrConstant(0)); | 123 return Load(rep, base, IntPtrConstant(0)); |
| 124 } | 124 } |
| 125 Node* Load(MachineType rep, Node* base, Node* index) { | 125 Node* Load(MachineType rep, Node* base, Node* index) { |
| 126 return AddNode(machine()->Load(rep), base, index, graph()->start(), | 126 return AddNode(machine()->Load(rep), base, index, graph()->start(), |
| 127 graph()->start()); | 127 graph()->start()); |
| 128 } | 128 } |
| 129 Node* Store(StoreRepresentation rep, Node* base, Node* value) { | 129 Node* Store(MachineType rep, Node* base, Node* value, |
| 130 return Store(rep, base, IntPtrConstant(0), value); | 130 WriteBarrierKind write_barrier) { |
| 131 return Store(rep, base, IntPtrConstant(0), value, write_barrier); | |
| 131 } | 132 } |
| 132 Node* Store(StoreRepresentation rep, Node* base, Node* index, Node* value) { | 133 Node* Store(MachineType rep, Node* base, Node* index, Node* value, |
| 133 return AddNode(machine()->Store(rep), base, index, value, graph()->start(), | 134 WriteBarrierKind write_barrier) { |
| 134 graph()->start()); | 135 return AddNode(machine()->Store(StoreRepresentation(rep, write_barrier)), |
| 136 base, index, value, graph()->start(), graph()->start()); | |
| 135 } | 137 } |
| 136 | 138 |
| 137 // Arithmetic Operations. | 139 // Arithmetic Operations. |
| 138 Node* WordAnd(Node* a, Node* b) { | 140 Node* WordAnd(Node* a, Node* b) { |
| 139 return AddNode(machine()->WordAnd(), a, b); | 141 return AddNode(machine()->WordAnd(), a, b); |
| 140 } | 142 } |
| 141 Node* WordOr(Node* a, Node* b) { return AddNode(machine()->WordOr(), a, b); } | 143 Node* WordOr(Node* a, Node* b) { return AddNode(machine()->WordOr(), a, b); } |
| 142 Node* WordXor(Node* a, Node* b) { | 144 Node* WordXor(Node* a, Node* b) { |
| 143 return AddNode(machine()->WordXor(), a, b); | 145 return AddNode(machine()->WordXor(), a, b); |
| 144 } | 146 } |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 491 Node* LoadStackPointer() { return AddNode(machine()->LoadStackPointer()); } | 493 Node* LoadStackPointer() { return AddNode(machine()->LoadStackPointer()); } |
| 492 Node* LoadFramePointer() { return AddNode(machine()->LoadFramePointer()); } | 494 Node* LoadFramePointer() { return AddNode(machine()->LoadFramePointer()); } |
| 493 | 495 |
| 494 // Parameters. | 496 // Parameters. |
| 495 Node* Parameter(size_t index); | 497 Node* Parameter(size_t index); |
| 496 | 498 |
| 497 // Pointer utilities. | 499 // Pointer utilities. |
| 498 Node* LoadFromPointer(void* address, MachineType rep, int32_t offset = 0) { | 500 Node* LoadFromPointer(void* address, MachineType rep, int32_t offset = 0) { |
| 499 return Load(rep, PointerConstant(address), Int32Constant(offset)); | 501 return Load(rep, PointerConstant(address), Int32Constant(offset)); |
| 500 } | 502 } |
| 501 Node* StoreToPointer(void* address, StoreRepresentation rep, Node* node) { | 503 Node* StoreToPointer(void* address, MachineType rep, Node* node) { |
| 502 return Store(rep, PointerConstant(address), node); | 504 return Store(rep, PointerConstant(address), node, kNoWriteBarrier); |
|
Michael Starzinger
2015/10/28 14:14:47
I think this default value is safe, because I cann
| |
| 503 } | 505 } |
| 504 Node* StringConstant(const char* string) { | 506 Node* StringConstant(const char* string) { |
| 505 return HeapConstant(isolate()->factory()->InternalizeUtf8String(string)); | 507 return HeapConstant(isolate()->factory()->InternalizeUtf8String(string)); |
| 506 } | 508 } |
| 507 | 509 |
| 508 // Call a given call descriptor and the given arguments. | 510 // Call a given call descriptor and the given arguments. |
| 509 Node* CallN(CallDescriptor* desc, Node* function, Node** args); | 511 Node* CallN(CallDescriptor* desc, Node* function, Node** args); |
| 510 // Call a given call descriptor and the given arguments and frame-state. | 512 // Call a given call descriptor and the given arguments and frame-state. |
| 511 Node* CallNWithFrameState(CallDescriptor* desc, Node* function, Node** args, | 513 Node* CallNWithFrameState(CallDescriptor* desc, Node* function, Node** args, |
| 512 Node* frame_state); | 514 Node* frame_state); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 600 BasicBlock* current_block_; | 602 BasicBlock* current_block_; |
| 601 | 603 |
| 602 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 604 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
| 603 }; | 605 }; |
| 604 | 606 |
| 605 } // namespace compiler | 607 } // namespace compiler |
| 606 } // namespace internal | 608 } // namespace internal |
| 607 } // namespace v8 | 609 } // namespace v8 |
| 608 | 610 |
| 609 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 611 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |