| 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/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 : block_(block), used_(false), bound_(false) {} | 38 : block_(block), used_(false), bound_(false) {} |
| 39 | 39 |
| 40 BasicBlock* block_; | 40 BasicBlock* block_; |
| 41 bool used_; | 41 bool used_; |
| 42 bool bound_; | 42 bool bound_; |
| 43 friend class RawMachineAssembler; | 43 friend class RawMachineAssembler; |
| 44 DISALLOW_COPY_AND_ASSIGN(Label); | 44 DISALLOW_COPY_AND_ASSIGN(Label); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 RawMachineAssembler(Graph* graph, MachineSignature* machine_sig, | 47 RawMachineAssembler(Graph* graph, MachineSignature* machine_sig, |
| 48 MachineType word = kMachPtr); | 48 MachineType word = kMachPtr, |
| 49 MachineOperatorBuilder::Flags flags = |
| 50 MachineOperatorBuilder::Flag::kNoFlags); |
| 49 virtual ~RawMachineAssembler() {} | 51 virtual ~RawMachineAssembler() {} |
| 50 | 52 |
| 51 Isolate* isolate() const { return zone()->isolate(); } | 53 Isolate* isolate() const { return zone()->isolate(); } |
| 52 Zone* zone() const { return graph()->zone(); } | 54 Zone* zone() const { return graph()->zone(); } |
| 53 MachineOperatorBuilder* machine() { return &machine_; } | 55 MachineOperatorBuilder* machine() { return &machine_; } |
| 54 CommonOperatorBuilder* common() { return &common_; } | 56 CommonOperatorBuilder* common() { return &common_; } |
| 55 CallDescriptor* call_descriptor() const { return call_descriptor_; } | 57 CallDescriptor* call_descriptor() const { return call_descriptor_; } |
| 56 size_t parameter_count() const { return machine_sig_->parameter_count(); } | 58 size_t parameter_count() const { return machine_sig_->parameter_count(); } |
| 57 MachineSignature* machine_sig() const { return machine_sig_; } | 59 MachineSignature* machine_sig() const { return machine_sig_; } |
| 58 | 60 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 375 } |
| 374 Node* TruncateFloat64ToFloat32(Node* a) { | 376 Node* TruncateFloat64ToFloat32(Node* a) { |
| 375 return NewNode(machine()->TruncateFloat64ToFloat32(), a); | 377 return NewNode(machine()->TruncateFloat64ToFloat32(), a); |
| 376 } | 378 } |
| 377 Node* TruncateFloat64ToInt32(Node* a) { | 379 Node* TruncateFloat64ToInt32(Node* a) { |
| 378 return NewNode(machine()->TruncateFloat64ToInt32(), a); | 380 return NewNode(machine()->TruncateFloat64ToInt32(), a); |
| 379 } | 381 } |
| 380 Node* TruncateInt64ToInt32(Node* a) { | 382 Node* TruncateInt64ToInt32(Node* a) { |
| 381 return NewNode(machine()->TruncateInt64ToInt32(), a); | 383 return NewNode(machine()->TruncateInt64ToInt32(), a); |
| 382 } | 384 } |
| 385 Node* Float64Floor(Node* a) { return NewNode(machine()->Float64Floor(), a); } |
| 386 Node* Float64Ceil(Node* a) { return NewNode(machine()->Float64Ceil(), a); } |
| 387 Node* Float64RoundTruncate(Node* a) { |
| 388 return NewNode(machine()->Float64RoundTruncate(), a); |
| 389 } |
| 390 Node* Float64RoundTiesAway(Node* a) { |
| 391 return NewNode(machine()->Float64RoundTiesAway(), a); |
| 392 } |
| 383 | 393 |
| 384 // Parameters. | 394 // Parameters. |
| 385 Node* Parameter(size_t index); | 395 Node* Parameter(size_t index); |
| 386 | 396 |
| 387 // Control flow. | 397 // Control flow. |
| 388 Label* Exit(); | 398 Label* Exit(); |
| 389 void Goto(Label* label); | 399 void Goto(Label* label); |
| 390 void Branch(Node* condition, Label* true_val, Label* false_val); | 400 void Branch(Node* condition, Label* true_val, Label* false_val); |
| 391 // Call through CallFunctionStub with lazy deopt and frame-state. | 401 // Call through CallFunctionStub with lazy deopt and frame-state. |
| 392 Node* CallFunctionStub0(Node* function, Node* receiver, Node* context, | 402 Node* CallFunctionStub0(Node* function, Node* receiver, Node* context, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 BasicBlock* current_block_; | 451 BasicBlock* current_block_; |
| 442 | 452 |
| 443 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 453 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
| 444 }; | 454 }; |
| 445 | 455 |
| 446 } // namespace compiler | 456 } // namespace compiler |
| 447 } // namespace internal | 457 } // namespace internal |
| 448 } // namespace v8 | 458 } // namespace v8 |
| 449 | 459 |
| 450 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 460 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |