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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 // Constants. | 70 // Constants. |
71 Node* PointerConstant(void* value) { | 71 Node* PointerConstant(void* value) { |
72 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); | 72 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); |
73 } | 73 } |
74 Node* IntPtrConstant(intptr_t value) { | 74 Node* IntPtrConstant(intptr_t value) { |
75 // TODO(dcarney): mark generated code as unserializable if value != 0. | 75 // TODO(dcarney): mark generated code as unserializable if value != 0. |
76 return kPointerSize == 8 ? Int64Constant(value) | 76 return kPointerSize == 8 ? Int64Constant(value) |
77 : Int32Constant(static_cast<int>(value)); | 77 : Int32Constant(static_cast<int>(value)); |
78 } | 78 } |
| 79 Node* RelocatableIntPtrConstant(intptr_t value, RelocInfo::Mode rmode); |
79 Node* Int32Constant(int32_t value) { | 80 Node* Int32Constant(int32_t value) { |
80 return AddNode(common()->Int32Constant(value)); | 81 return AddNode(common()->Int32Constant(value)); |
81 } | 82 } |
82 Node* StackSlot(MachineRepresentation rep) { | 83 Node* StackSlot(MachineRepresentation rep) { |
83 return AddNode(machine()->StackSlot(rep)); | 84 return AddNode(machine()->StackSlot(rep)); |
84 } | 85 } |
85 Node* Int64Constant(int64_t value) { | 86 Node* Int64Constant(int64_t value) { |
86 return AddNode(common()->Int64Constant(value)); | 87 return AddNode(common()->Int64Constant(value)); |
87 } | 88 } |
88 Node* NumberConstant(double value) { | 89 Node* NumberConstant(double value) { |
89 return AddNode(common()->NumberConstant(value)); | 90 return AddNode(common()->NumberConstant(value)); |
90 } | 91 } |
91 Node* Float32Constant(float value) { | 92 Node* Float32Constant(float value) { |
92 return AddNode(common()->Float32Constant(value)); | 93 return AddNode(common()->Float32Constant(value)); |
93 } | 94 } |
94 Node* Float64Constant(double value) { | 95 Node* Float64Constant(double value) { |
95 return AddNode(common()->Float64Constant(value)); | 96 return AddNode(common()->Float64Constant(value)); |
96 } | 97 } |
97 Node* HeapConstant(Handle<HeapObject> object) { | 98 Node* HeapConstant(Handle<HeapObject> object) { |
98 return AddNode(common()->HeapConstant(object)); | 99 return AddNode(common()->HeapConstant(object)); |
99 } | 100 } |
100 Node* BooleanConstant(bool value) { | 101 Node* BooleanConstant(bool value) { |
101 Handle<Object> object = isolate()->factory()->ToBoolean(value); | 102 Handle<Object> object = isolate()->factory()->ToBoolean(value); |
102 return HeapConstant(Handle<HeapObject>::cast(object)); | 103 return HeapConstant(Handle<HeapObject>::cast(object)); |
103 } | 104 } |
104 Node* ExternalConstant(ExternalReference address) { | 105 Node* ExternalConstant(ExternalReference address) { |
105 return AddNode(common()->ExternalConstant(address)); | 106 return AddNode(common()->ExternalConstant(address)); |
106 } | 107 } |
| 108 Node* RelocatableInt32Constant(int32_t value, RelocInfo::Mode rmode) { |
| 109 return AddNode(common()->RelocatableInt32Constant(value, rmode)); |
| 110 } |
| 111 Node* RelocatableInt64Constant(int64_t value, RelocInfo::Mode rmode) { |
| 112 return AddNode(common()->RelocatableInt64Constant(value, rmode)); |
| 113 } |
107 | 114 |
108 Node* Projection(int index, Node* a) { | 115 Node* Projection(int index, Node* a) { |
109 return AddNode(common()->Projection(index), a); | 116 return AddNode(common()->Projection(index), a); |
110 } | 117 } |
111 | 118 |
112 // Memory Operations. | 119 // Memory Operations. |
113 Node* Load(MachineType rep, Node* base) { | 120 Node* Load(MachineType rep, Node* base) { |
114 return Load(rep, base, IntPtrConstant(0)); | 121 return Load(rep, base, IntPtrConstant(0)); |
115 } | 122 } |
116 Node* Load(MachineType rep, Node* base, Node* index) { | 123 Node* Load(MachineType rep, Node* base, Node* index) { |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 bool deferred_; | 735 bool deferred_; |
729 friend class RawMachineAssembler; | 736 friend class RawMachineAssembler; |
730 DISALLOW_COPY_AND_ASSIGN(RawMachineLabel); | 737 DISALLOW_COPY_AND_ASSIGN(RawMachineLabel); |
731 }; | 738 }; |
732 | 739 |
733 } // namespace compiler | 740 } // namespace compiler |
734 } // namespace internal | 741 } // namespace internal |
735 } // namespace v8 | 742 } // namespace v8 |
736 | 743 |
737 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 744 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
OLD | NEW |