| 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_STRUCTURED_MACHINE_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ |
| 6 #define V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ | 6 #define V8_COMPILER_STRUCTURED_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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 DISALLOW_COPY_AND_ASSIGN(Environment); | 56 DISALLOW_COPY_AND_ASSIGN(Environment); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 class IfBuilder; | 59 class IfBuilder; |
| 60 friend class IfBuilder; | 60 friend class IfBuilder; |
| 61 class LoopBuilder; | 61 class LoopBuilder; |
| 62 friend class LoopBuilder; | 62 friend class LoopBuilder; |
| 63 | 63 |
| 64 StructuredMachineAssembler( | 64 StructuredMachineAssembler( |
| 65 Graph* graph, MachineCallDescriptorBuilder* call_descriptor_builder, | 65 Graph* graph, MachineCallDescriptorBuilder* call_descriptor_builder, |
| 66 MachineRepresentation word = MachineOperatorBuilder::pointer_rep()); | 66 MachineType word = MachineOperatorBuilder::pointer_rep()); |
| 67 virtual ~StructuredMachineAssembler() {} | 67 virtual ~StructuredMachineAssembler() {} |
| 68 | 68 |
| 69 Isolate* isolate() const { return zone()->isolate(); } | 69 Isolate* isolate() const { return zone()->isolate(); } |
| 70 Zone* zone() const { return graph()->zone(); } | 70 Zone* zone() const { return graph()->zone(); } |
| 71 MachineOperatorBuilder* machine() { return &machine_; } | 71 MachineOperatorBuilder* machine() { return &machine_; } |
| 72 CommonOperatorBuilder* common() { return &common_; } | 72 CommonOperatorBuilder* common() { return &common_; } |
| 73 CallDescriptor* call_descriptor() const { | 73 CallDescriptor* call_descriptor() const { |
| 74 return call_descriptor_builder_->BuildCallDescriptor(zone()); | 74 return call_descriptor_builder_->BuildCallDescriptor(zone()); |
| 75 } | 75 } |
| 76 int parameter_count() const { | 76 int parameter_count() const { |
| 77 return call_descriptor_builder_->parameter_count(); | 77 return call_descriptor_builder_->parameter_count(); |
| 78 } | 78 } |
| 79 const MachineRepresentation* parameter_types() const { | 79 const MachineType* parameter_types() const { |
| 80 return call_descriptor_builder_->parameter_types(); | 80 return call_descriptor_builder_->parameter_types(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Parameters. | 83 // Parameters. |
| 84 Node* Parameter(int index); | 84 Node* Parameter(int index); |
| 85 // Variables. | 85 // Variables. |
| 86 Variable NewVariable(Node* initial_value); | 86 Variable NewVariable(Node* initial_value); |
| 87 // Control flow. | 87 // Control flow. |
| 88 void Return(Node* value); | 88 void Return(Node* value); |
| 89 | 89 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 117 void CopyCurrentAsDead(); | 117 void CopyCurrentAsDead(); |
| 118 Environment* Copy(Environment* environment) { | 118 Environment* Copy(Environment* environment) { |
| 119 return Copy(environment, static_cast<int>(environment->variables_.size())); | 119 return Copy(environment, static_cast<int>(environment->variables_.size())); |
| 120 } | 120 } |
| 121 Environment* Copy(Environment* environment, int truncate_at); | 121 Environment* Copy(Environment* environment, int truncate_at); |
| 122 void Merge(EnvironmentVector* environments, int truncate_at); | 122 void Merge(EnvironmentVector* environments, int truncate_at); |
| 123 Environment* CopyForLoopHeader(Environment* environment); | 123 Environment* CopyForLoopHeader(Environment* environment); |
| 124 void MergeBackEdgesToLoopHeader(Environment* header, | 124 void MergeBackEdgesToLoopHeader(Environment* header, |
| 125 EnvironmentVector* environments); | 125 EnvironmentVector* environments); |
| 126 | 126 |
| 127 typedef std::vector<MachineRepresentation, | 127 typedef std::vector<MachineType, zone_allocator<MachineType> > |
| 128 zone_allocator<MachineRepresentation> > | |
| 129 RepresentationVector; | 128 RepresentationVector; |
| 130 | 129 |
| 131 Schedule* schedule_; | 130 Schedule* schedule_; |
| 132 MachineOperatorBuilder machine_; | 131 MachineOperatorBuilder machine_; |
| 133 CommonOperatorBuilder common_; | 132 CommonOperatorBuilder common_; |
| 134 MachineCallDescriptorBuilder* call_descriptor_builder_; | 133 MachineCallDescriptorBuilder* call_descriptor_builder_; |
| 135 Node** parameters_; | 134 Node** parameters_; |
| 136 Environment* current_environment_; | 135 Environment* current_environment_; |
| 137 int number_of_variables_; | 136 int number_of_variables_; |
| 138 | 137 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 EnvironmentVector pending_header_merges_; | 302 EnvironmentVector pending_header_merges_; |
| 304 EnvironmentVector pending_exit_merges_; | 303 EnvironmentVector pending_exit_merges_; |
| 305 DISALLOW_COPY_AND_ASSIGN(LoopBuilder); | 304 DISALLOW_COPY_AND_ASSIGN(LoopBuilder); |
| 306 }; | 305 }; |
| 307 | 306 |
| 308 } // namespace compiler | 307 } // namespace compiler |
| 309 } // namespace internal | 308 } // namespace internal |
| 310 } // namespace v8 | 309 } // namespace v8 |
| 311 | 310 |
| 312 #endif // V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ | 311 #endif // V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |