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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // Finalizes the schedule and exports it to be used for code generation. Note | 69 // Finalizes the schedule and exports it to be used for code generation. Note |
70 // that this RawMachineAssembler becomes invalid after export. | 70 // that this RawMachineAssembler becomes invalid after export. |
71 Schedule* Export(); | 71 Schedule* Export(); |
72 | 72 |
73 // =========================================================================== | 73 // =========================================================================== |
74 // The following utility methods create new nodes with specific operators and | 74 // The following utility methods create new nodes with specific operators and |
75 // place them into the current basic block. They don't perform control flow, | 75 // place them into the current basic block. They don't perform control flow, |
76 // hence will not switch the current basic block. | 76 // hence will not switch the current basic block. |
77 | 77 |
| 78 Node* NullConstant() { |
| 79 return HeapConstant(isolate()->factory()->null_value()); |
| 80 } |
| 81 |
78 Node* UndefinedConstant() { | 82 Node* UndefinedConstant() { |
79 return HeapConstant(isolate()->factory()->undefined_value()); | 83 return HeapConstant(isolate()->factory()->undefined_value()); |
80 } | 84 } |
81 | 85 |
82 // Constants. | 86 // Constants. |
83 Node* PointerConstant(void* value) { | 87 Node* PointerConstant(void* value) { |
84 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); | 88 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); |
85 } | 89 } |
86 Node* IntPtrConstant(intptr_t value) { | 90 Node* IntPtrConstant(intptr_t value) { |
87 // TODO(dcarney): mark generated code as unserializable if value != 0. | 91 // TODO(dcarney): mark generated code as unserializable if value != 0. |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 BasicBlock* current_block_; | 604 BasicBlock* current_block_; |
601 | 605 |
602 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 606 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
603 }; | 607 }; |
604 | 608 |
605 } // namespace compiler | 609 } // namespace compiler |
606 } // namespace internal | 610 } // namespace internal |
607 } // namespace v8 | 611 } // namespace v8 |
608 | 612 |
609 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 613 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
OLD | NEW |