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 #ifndef V8_COMPILER_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_COMPILER_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_COMPILER_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 // Clients of this interface shouldn't depend on lots of compiler internals. | 10 // Clients of this interface shouldn't depend on lots of compiler internals. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Constants. | 135 // Constants. |
136 Node* Int32Constant(int value); | 136 Node* Int32Constant(int value); |
137 Node* IntPtrConstant(intptr_t value); | 137 Node* IntPtrConstant(intptr_t value); |
138 Node* NumberConstant(double value); | 138 Node* NumberConstant(double value); |
139 Node* SmiConstant(Smi* value); | 139 Node* SmiConstant(Smi* value); |
140 Node* HeapConstant(Handle<HeapObject> object); | 140 Node* HeapConstant(Handle<HeapObject> object); |
141 Node* BooleanConstant(bool value); | 141 Node* BooleanConstant(bool value); |
142 Node* ExternalConstant(ExternalReference address); | 142 Node* ExternalConstant(ExternalReference address); |
143 Node* Float64Constant(double value); | 143 Node* Float64Constant(double value); |
144 Node* HeapNumberMapConstant(); | 144 Node* HeapNumberMapConstant(); |
| 145 Node* NullConstant(); |
| 146 Node* UndefinedConstant(); |
145 | 147 |
146 Node* Parameter(int value); | 148 Node* Parameter(int value); |
147 void Return(Node* value); | 149 void Return(Node* value); |
148 | 150 |
149 void Bind(Label* label); | 151 void Bind(Label* label); |
150 void Goto(Label* label); | 152 void Goto(Label* label); |
151 void Branch(Node* condition, Label* true_label, Label* false_label); | 153 void Branch(Node* condition, Label* true_label, Label* false_label); |
152 | 154 |
153 void Switch(Node* index, Label* default_label, int32_t* case_values, | 155 void Switch(Node* index, Label* default_label, int32_t* case_values, |
154 Label** case_labels, size_t case_count); | 156 Label** case_labels, size_t case_count); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 Node* SmiLessThanOrEqual(Node* a, Node* b); | 257 Node* SmiLessThanOrEqual(Node* a, Node* b); |
256 Node* SmiMin(Node* a, Node* b); | 258 Node* SmiMin(Node* a, Node* b); |
257 | 259 |
258 // Load a value from the root array. | 260 // Load a value from the root array. |
259 Node* LoadRoot(Heap::RootListIndex root_index); | 261 Node* LoadRoot(Heap::RootListIndex root_index); |
260 | 262 |
261 // Check a value for smi-ness | 263 // Check a value for smi-ness |
262 Node* WordIsSmi(Node* a); | 264 Node* WordIsSmi(Node* a); |
263 | 265 |
264 // Load an object pointer from a buffer that isn't in the heap. | 266 // Load an object pointer from a buffer that isn't in the heap. |
265 Node* LoadBufferObject(Node* buffer, int offset); | 267 Node* LoadBufferObject(Node* buffer, int offset, |
| 268 MachineType rep = MachineType::AnyTagged()); |
266 // Load a field from an object on the heap. | 269 // Load a field from an object on the heap. |
267 Node* LoadObjectField(Node* object, int offset); | 270 Node* LoadObjectField(Node* object, int offset, |
| 271 MachineType rep = MachineType::AnyTagged()); |
268 // Load the floating point value of a HeapNumber. | 272 // Load the floating point value of a HeapNumber. |
269 Node* LoadHeapNumberValue(Node* object); | 273 Node* LoadHeapNumberValue(Node* object); |
270 // Load the instance type of a Map. | 274 // Load the instance type of a Map. |
271 Node* LoadMapInstanceType(Node* map); | 275 Node* LoadMapInstanceType(Node* map); |
272 | 276 |
273 // Load an array element from a FixedArray. | 277 // Load an array element from a FixedArray. |
274 Node* LoadFixedArrayElementSmiIndex(Node* object, Node* smi_index, | 278 Node* LoadFixedArrayElementSmiIndex(Node* object, Node* smi_index, |
275 int additional_offset = 0); | 279 int additional_offset = 0); |
276 Node* LoadFixedArrayElementConstantIndex(Node* object, int index); | 280 Node* LoadFixedArrayElementConstantIndex(Node* object, int index); |
277 | 281 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 // Protected helpers which delegate to RawMachineAssembler. | 323 // Protected helpers which delegate to RawMachineAssembler. |
320 Graph* graph() const; | 324 Graph* graph() const; |
321 | 325 |
322 // Enables subclasses to perform operations before and after a call. | 326 // Enables subclasses to perform operations before and after a call. |
323 virtual void CallPrologue(); | 327 virtual void CallPrologue(); |
324 virtual void CallEpilogue(); | 328 virtual void CallEpilogue(); |
325 | 329 |
326 private: | 330 private: |
327 friend class CodeStubAssemblerTester; | 331 friend class CodeStubAssemblerTester; |
328 | 332 |
| 333 CodeStubAssembler(Isolate* isolate, Zone* zone, |
| 334 CallDescriptor* call_descriptor, Code::Flags flags, |
| 335 const char* name); |
| 336 |
329 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); | 337 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); |
330 Node* TailCallN(CallDescriptor* descriptor, Node* code_target, Node** args); | 338 Node* TailCallN(CallDescriptor* descriptor, Node* code_target, Node** args); |
331 | 339 |
332 Node* SmiShiftBitsConstant(); | 340 Node* SmiShiftBitsConstant(); |
333 | 341 |
334 Node* AllocateRawAligned(Node* size_in_bytes, AllocationFlags flags, | 342 Node* AllocateRawAligned(Node* size_in_bytes, AllocationFlags flags, |
335 Node* top_address, Node* limit_address); | 343 Node* top_address, Node* limit_address); |
336 Node* AllocateRawUnaligned(Node* size_in_bytes, AllocationFlags flags, | 344 Node* AllocateRawUnaligned(Node* size_in_bytes, AllocationFlags flags, |
337 Node* top_adddress, Node* limit_address); | 345 Node* top_adddress, Node* limit_address); |
338 | 346 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 // Map of variables to the list of value nodes that have been added from each | 390 // Map of variables to the list of value nodes that have been added from each |
383 // merge path in their order of merging. | 391 // merge path in their order of merging. |
384 std::map<Variable::Impl*, std::vector<Node*>> variable_merges_; | 392 std::map<Variable::Impl*, std::vector<Node*>> variable_merges_; |
385 }; | 393 }; |
386 | 394 |
387 } // namespace compiler | 395 } // namespace compiler |
388 } // namespace internal | 396 } // namespace internal |
389 } // namespace v8 | 397 } // namespace v8 |
390 | 398 |
391 #endif // V8_COMPILER_CODE_STUB_ASSEMBLER_H_ | 399 #endif // V8_COMPILER_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |