| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 class CallDescriptor; | 30 class CallDescriptor; |
| 31 class Graph; | 31 class Graph; |
| 32 class Node; | 32 class Node; |
| 33 class Operator; | 33 class Operator; |
| 34 class RawMachineAssembler; | 34 class RawMachineAssembler; |
| 35 class RawMachineLabel; | 35 class RawMachineLabel; |
| 36 class Schedule; | 36 class Schedule; |
| 37 | 37 |
| 38 #define CODE_STUB_ASSEMBLER_BINARY_OP_LIST(V) \ | 38 #define CODE_STUB_ASSEMBLER_BINARY_OP_LIST(V) \ |
| 39 V(Float32Equal) \ |
| 40 V(Float32LessThan) \ |
| 41 V(Float32LessThanOrEqual) \ |
| 42 V(Float32GreaterThan) \ |
| 43 V(Float32GreaterThanOrEqual) \ |
| 39 V(Float64Equal) \ | 44 V(Float64Equal) \ |
| 40 V(Float64LessThan) \ | 45 V(Float64LessThan) \ |
| 41 V(Float64LessThanOrEqual) \ | 46 V(Float64LessThanOrEqual) \ |
| 42 V(Float64GreaterThan) \ | 47 V(Float64GreaterThan) \ |
| 43 V(Float64GreaterThanOrEqual) \ | 48 V(Float64GreaterThanOrEqual) \ |
| 44 V(IntPtrAdd) \ | 49 V(IntPtrAdd) \ |
| 45 V(IntPtrSub) \ | 50 V(IntPtrSub) \ |
| 46 V(Int32Add) \ | 51 V(Int32Add) \ |
| 47 V(Int32Sub) \ | 52 V(Int32Sub) \ |
| 48 V(Int32Mul) \ | 53 V(Int32Mul) \ |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 139 |
| 135 // Constants. | 140 // Constants. |
| 136 Node* Int32Constant(int value); | 141 Node* Int32Constant(int value); |
| 137 Node* IntPtrConstant(intptr_t value); | 142 Node* IntPtrConstant(intptr_t value); |
| 138 Node* NumberConstant(double value); | 143 Node* NumberConstant(double value); |
| 139 Node* SmiConstant(Smi* value); | 144 Node* SmiConstant(Smi* value); |
| 140 Node* HeapConstant(Handle<HeapObject> object); | 145 Node* HeapConstant(Handle<HeapObject> object); |
| 141 Node* BooleanConstant(bool value); | 146 Node* BooleanConstant(bool value); |
| 142 Node* ExternalConstant(ExternalReference address); | 147 Node* ExternalConstant(ExternalReference address); |
| 143 Node* Float64Constant(double value); | 148 Node* Float64Constant(double value); |
| 149 Node* BooleanMapConstant(); |
| 144 Node* HeapNumberMapConstant(); | 150 Node* HeapNumberMapConstant(); |
| 145 | 151 |
| 146 Node* Parameter(int value); | 152 Node* Parameter(int value); |
| 147 void Return(Node* value); | 153 void Return(Node* value); |
| 148 | 154 |
| 149 void Bind(Label* label); | 155 void Bind(Label* label); |
| 150 void Goto(Label* label); | 156 void Goto(Label* label); |
| 151 void Branch(Node* condition, Label* true_label, Label* false_label); | 157 void Branch(Node* condition, Label* true_label, Label* false_label); |
| 152 | 158 |
| 153 void Switch(Node* index, Label* default_label, int32_t* case_values, | 159 void Switch(Node* index, Label* default_label, int32_t* case_values, |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 266 |
| 261 // Check a value for smi-ness | 267 // Check a value for smi-ness |
| 262 Node* WordIsSmi(Node* a); | 268 Node* WordIsSmi(Node* a); |
| 263 | 269 |
| 264 // Load an object pointer from a buffer that isn't in the heap. | 270 // Load an object pointer from a buffer that isn't in the heap. |
| 265 Node* LoadBufferObject(Node* buffer, int offset); | 271 Node* LoadBufferObject(Node* buffer, int offset); |
| 266 // Load a field from an object on the heap. | 272 // Load a field from an object on the heap. |
| 267 Node* LoadObjectField(Node* object, int offset); | 273 Node* LoadObjectField(Node* object, int offset); |
| 268 // Load the floating point value of a HeapNumber. | 274 // Load the floating point value of a HeapNumber. |
| 269 Node* LoadHeapNumberValue(Node* object); | 275 Node* LoadHeapNumberValue(Node* object); |
| 276 // Load the bit field of a Map. |
| 277 Node* LoadMapBitField(Node* map); |
| 270 // Load the instance type of a Map. | 278 // Load the instance type of a Map. |
| 271 Node* LoadMapInstanceType(Node* map); | 279 Node* LoadMapInstanceType(Node* map); |
| 272 | 280 |
| 273 // Load an array element from a FixedArray. | 281 // Load an array element from a FixedArray. |
| 274 Node* LoadFixedArrayElementSmiIndex(Node* object, Node* smi_index, | 282 Node* LoadFixedArrayElementSmiIndex(Node* object, Node* smi_index, |
| 275 int additional_offset = 0); | 283 int additional_offset = 0); |
| 276 Node* LoadFixedArrayElementConstantIndex(Node* object, int index); | 284 Node* LoadFixedArrayElementConstantIndex(Node* object, int index); |
| 277 | 285 |
| 278 // Allocate an object of the given size. | 286 // Allocate an object of the given size. |
| 279 Node* Allocate(int size, AllocationFlags flags); | 287 Node* Allocate(int size, AllocationFlags flags); |
| 280 | 288 |
| 281 // Store an array element to a FixedArray. | 289 // Store an array element to a FixedArray. |
| 282 Node* StoreFixedArrayElementNoWriteBarrier(Node* object, Node* index, | 290 Node* StoreFixedArrayElementNoWriteBarrier(Node* object, Node* index, |
| 283 Node* value); | 291 Node* value); |
| 292 // Load the Map of an HeapObject. |
| 293 Node* LoadMap(Node* object); |
| 294 // Load the instance type of an HeapObject. |
| 284 Node* LoadInstanceType(Node* object); | 295 Node* LoadInstanceType(Node* object); |
| 285 | 296 |
| 286 // Returns a node that is true if the given bit is set in |word32|. | 297 // Returns a node that is true if the given bit is set in |word32|. |
| 287 template <typename T> | 298 template <typename T> |
| 288 Node* BitFieldDecode(Node* word32) { | 299 Node* BitFieldDecode(Node* word32) { |
| 289 return BitFieldDecode(word32, T::kShift, T::kMask); | 300 return BitFieldDecode(word32, T::kShift, T::kMask); |
| 290 } | 301 } |
| 291 | 302 |
| 292 Node* BitFieldDecode(Node* word32, uint32_t shift, uint32_t mask); | 303 Node* BitFieldDecode(Node* word32, uint32_t shift, uint32_t mask); |
| 293 | 304 |
| 294 // Branching helpers. | 305 // Branching helpers. |
| 295 // TODO(danno): Can we be more cleverish wrt. edge-split? | 306 // TODO(danno): Can we be more cleverish wrt. edge-split? |
| 296 void BranchIfInt32LessThan(Node* a, Node* b, Label* if_true, Label* if_false); | 307 void BranchIfInt32LessThan(Node* a, Node* b, Label* if_true, Label* if_false); |
| 297 void BranchIfSmiLessThan(Node* a, Node* b, Label* if_true, Label* if_false); | 308 void BranchIfSmiLessThan(Node* a, Node* b, Label* if_true, Label* if_false); |
| 298 void BranchIfSmiLessThanOrEqual(Node* a, Node* b, Label* if_true, | 309 void BranchIfSmiLessThanOrEqual(Node* a, Node* b, Label* if_true, |
| 299 Label* if_false); | 310 Label* if_false); |
| 300 void BranchIfFloat64Equal(Node* a, Node* b, Label* if_true, Label* if_false); | 311 void BranchIfFloat64Equal(Node* a, Node* b, Label* if_true, Label* if_false); |
| 301 void BranchIfFloat64LessThan(Node* a, Node* b, Label* if_true, | 312 void BranchIfFloat64LessThan(Node* a, Node* b, Label* if_true, |
| 302 Label* if_false); | 313 Label* if_false); |
| 303 void BranchIfFloat64LessThanOrEqual(Node* a, Node* b, Label* if_true, | 314 void BranchIfFloat64LessThanOrEqual(Node* a, Node* b, Label* if_true, |
| 304 Label* if_false); | 315 Label* if_false); |
| 305 void BranchIfFloat64GreaterThan(Node* a, Node* b, Label* if_true, | 316 void BranchIfFloat64GreaterThan(Node* a, Node* b, Label* if_true, |
| 306 Label* if_false); | 317 Label* if_false); |
| 307 void BranchIfFloat64GreaterThanOrEqual(Node* a, Node* b, Label* if_true, | 318 void BranchIfFloat64GreaterThanOrEqual(Node* a, Node* b, Label* if_true, |
| 308 Label* if_false); | 319 Label* if_false); |
| 309 void BranchIfFloat64IsNaN(Node* value, Label* if_true, Label* if_false) { | 320 void BranchIfFloat64IsNaN(Node* value, Label* if_true, Label* if_false) { |
| 310 BranchIfFloat64Equal(value, value, if_false, if_true); | 321 BranchIfFloat64Equal(value, value, if_false, if_true); |
| 311 } | 322 } |
| 323 void BranchIfWord32Equal(Node* a, Node* b, Label* if_true, Label* if_false); |
| 312 | 324 |
| 313 // Helpers which delegate to RawMachineAssembler. | 325 // Helpers which delegate to RawMachineAssembler. |
| 314 Factory* factory() const; | 326 Factory* factory() const; |
| 315 Isolate* isolate() const; | 327 Isolate* isolate() const; |
| 316 Zone* zone() const; | 328 Zone* zone() const; |
| 317 | 329 |
| 318 protected: | 330 protected: |
| 319 // Protected helpers which delegate to RawMachineAssembler. | 331 // Protected helpers which delegate to RawMachineAssembler. |
| 320 Graph* graph() const; | 332 Graph* graph() const; |
| 321 | 333 |
| (...skipping 60 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 | 394 // Map of variables to the list of value nodes that have been added from each |
| 383 // merge path in their order of merging. | 395 // merge path in their order of merging. |
| 384 std::map<Variable::Impl*, std::vector<Node*>> variable_merges_; | 396 std::map<Variable::Impl*, std::vector<Node*>> variable_merges_; |
| 385 }; | 397 }; |
| 386 | 398 |
| 387 } // namespace compiler | 399 } // namespace compiler |
| 388 } // namespace internal | 400 } // namespace internal |
| 389 } // namespace v8 | 401 } // namespace v8 |
| 390 | 402 |
| 391 #endif // V8_COMPILER_CODE_STUB_ASSEMBLER_H_ | 403 #endif // V8_COMPILER_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |