Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 bool is_dead_; | 54 bool is_dead_; |
| 55 friend class StructuredMachineAssembler; | 55 friend class StructuredMachineAssembler; |
| 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(Graph* graph, MachineSignature* machine_sig, |
| 65 Graph* graph, MachineCallDescriptorBuilder* call_descriptor_builder, | 65 MachineType word = kMachPtr); |
| 66 MachineType word = kMachPtr); | |
| 67 virtual ~StructuredMachineAssembler() {} | 66 virtual ~StructuredMachineAssembler() {} |
| 68 | 67 |
| 69 Isolate* isolate() const { return zone()->isolate(); } | 68 Isolate* isolate() const { return zone()->isolate(); } |
| 70 Zone* zone() const { return graph()->zone(); } | 69 Zone* zone() const { return graph()->zone(); } |
| 71 MachineOperatorBuilder* machine() { return &machine_; } | 70 MachineOperatorBuilder* machine() { return &machine_; } |
| 72 CommonOperatorBuilder* common() { return &common_; } | 71 CommonOperatorBuilder* common() { return &common_; } |
| 73 CallDescriptor* call_descriptor() const { | 72 CallDescriptor* call_descriptor() const { return call_descriptor_; } |
| 74 return call_descriptor_builder_->BuildCallDescriptor(zone()); | 73 int parameter_count() { return machine_sig_->ParamCount(); } |
|
Benedikt Meurer
2014/09/02 08:37:42
Nit: size_t + const
titzer
2014/09/02 12:13:53
Done.
| |
| 75 } | 74 MachineSignature* machine_sig() const { return machine_sig_; } |
| 76 int parameter_count() const { | |
| 77 return call_descriptor_builder_->parameter_count(); | |
| 78 } | |
| 79 const MachineType* parameter_types() const { | |
| 80 return call_descriptor_builder_->parameter_types(); | |
| 81 } | |
| 82 | 75 |
| 83 // Parameters. | 76 // Parameters. |
| 84 Node* Parameter(int index); | 77 Node* Parameter(int index); |
| 85 // Variables. | 78 // Variables. |
| 86 Variable NewVariable(Node* initial_value); | 79 Variable NewVariable(Node* initial_value); |
| 87 // Control flow. | 80 // Control flow. |
| 88 void Return(Node* value); | 81 void Return(Node* value); |
| 89 | 82 |
| 90 // MachineAssembler is invalid after export. | 83 // MachineAssembler is invalid after export. |
| 91 Schedule* Export(); | 84 Schedule* Export(); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 119 } | 112 } |
| 120 Environment* Copy(Environment* environment, int truncate_at); | 113 Environment* Copy(Environment* environment, int truncate_at); |
| 121 void Merge(EnvironmentVector* environments, int truncate_at); | 114 void Merge(EnvironmentVector* environments, int truncate_at); |
| 122 Environment* CopyForLoopHeader(Environment* environment); | 115 Environment* CopyForLoopHeader(Environment* environment); |
| 123 void MergeBackEdgesToLoopHeader(Environment* header, | 116 void MergeBackEdgesToLoopHeader(Environment* header, |
| 124 EnvironmentVector* environments); | 117 EnvironmentVector* environments); |
| 125 | 118 |
| 126 Schedule* schedule_; | 119 Schedule* schedule_; |
| 127 MachineOperatorBuilder machine_; | 120 MachineOperatorBuilder machine_; |
| 128 CommonOperatorBuilder common_; | 121 CommonOperatorBuilder common_; |
| 129 MachineCallDescriptorBuilder* call_descriptor_builder_; | 122 MachineSignature* machine_sig_; |
| 123 CallDescriptor* call_descriptor_; | |
| 130 Node** parameters_; | 124 Node** parameters_; |
| 131 Environment* current_environment_; | 125 Environment* current_environment_; |
| 132 int number_of_variables_; | 126 int number_of_variables_; |
| 133 | 127 |
| 134 friend class Variable; | 128 friend class Variable; |
| 135 // For testing only. | 129 // For testing only. |
| 136 friend class StructuredMachineAssemblerFriend; | 130 friend class StructuredMachineAssemblerFriend; |
| 137 DISALLOW_COPY_AND_ASSIGN(StructuredMachineAssembler); | 131 DISALLOW_COPY_AND_ASSIGN(StructuredMachineAssembler); |
| 138 }; | 132 }; |
| 139 | 133 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 EnvironmentVector pending_header_merges_; | 290 EnvironmentVector pending_header_merges_; |
| 297 EnvironmentVector pending_exit_merges_; | 291 EnvironmentVector pending_exit_merges_; |
| 298 DISALLOW_COPY_AND_ASSIGN(LoopBuilder); | 292 DISALLOW_COPY_AND_ASSIGN(LoopBuilder); |
| 299 }; | 293 }; |
| 300 | 294 |
| 301 } // namespace compiler | 295 } // namespace compiler |
| 302 } // namespace internal | 296 } // namespace internal |
| 303 } // namespace v8 | 297 } // namespace v8 |
| 304 | 298 |
| 305 #endif // V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ | 299 #endif // V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |