| 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_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ |
| 6 #define V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 MachineCallHelper(Zone* zone, MachineCallDescriptorBuilder* builder); | 40 MachineCallHelper(Zone* zone, MachineCallDescriptorBuilder* builder); |
| 41 | 41 |
| 42 Node* Parameter(int offset); | 42 Node* Parameter(int offset); |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 virtual byte* Generate(); | 45 virtual byte* Generate(); |
| 46 virtual void VerifyParameters(int parameter_count, | 46 virtual void VerifyParameters(int parameter_count, |
| 47 MachineRepresentation* parameters); | 47 MachineRepresentation* parameters); |
| 48 void InitParameters(GraphBuilder* builder, CommonOperatorBuilder* common); | 48 void InitParameters(GraphBuilder* builder, CommonOperatorBuilder* common); |
| 49 | 49 |
| 50 private: | 50 protected: |
| 51 int parameter_count() const { | 51 int parameter_count() const { |
| 52 return call_descriptor_builder_->parameter_count(); | 52 return call_descriptor_builder_->parameter_count(); |
| 53 } | 53 } |
| 54 |
| 55 private: |
| 54 MachineCallDescriptorBuilder* call_descriptor_builder_; | 56 MachineCallDescriptorBuilder* call_descriptor_builder_; |
| 55 Node** parameters_; | 57 Node** parameters_; |
| 56 // TODO(dcarney): shouldn't need graph stored. | 58 // TODO(dcarney): shouldn't need graph stored. |
| 57 Graph* graph_; | 59 Graph* graph_; |
| 58 MaybeHandle<Code> code_; | 60 MaybeHandle<Code> code_; |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 | 63 |
| 62 class GraphAndBuilders { | 64 class GraphAndBuilders { |
| 63 public: | 65 public: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 90 MachineRepresentation p3 = kMachineLast, | 92 MachineRepresentation p3 = kMachineLast, |
| 91 MachineRepresentation p4 = kMachineLast) | 93 MachineRepresentation p4 = kMachineLast) |
| 92 : GraphAndBuilders(main_zone()), | 94 : GraphAndBuilders(main_zone()), |
| 93 MachineCallHelper( | 95 MachineCallHelper( |
| 94 main_zone(), | 96 main_zone(), |
| 95 ToCallDescriptorBuilder( | 97 ToCallDescriptorBuilder( |
| 96 main_zone(), ReturnValueTraits<ReturnType>::Representation(), | 98 main_zone(), ReturnValueTraits<ReturnType>::Representation(), |
| 97 p0, p1, p2, p3, p4)), | 99 p0, p1, p2, p3, p4)), |
| 98 SimplifiedGraphBuilder(main_graph_, &main_common_, &main_machine_, | 100 SimplifiedGraphBuilder(main_graph_, &main_common_, &main_machine_, |
| 99 &main_simplified_) { | 101 &main_simplified_) { |
| 100 Begin(); | 102 Begin(parameter_count()); |
| 101 InitParameters(this, &main_common_); | 103 InitParameters(this, &main_common_); |
| 102 } | 104 } |
| 103 virtual ~GraphBuilderTester() {} | 105 virtual ~GraphBuilderTester() {} |
| 104 | 106 |
| 105 Factory* factory() const { return isolate()->factory(); } | 107 Factory* factory() const { return isolate()->factory(); } |
| 106 }; | 108 }; |
| 107 } // namespace compiler | 109 } // namespace compiler |
| 108 } // namespace internal | 110 } // namespace internal |
| 109 } // namespace v8 | 111 } // namespace v8 |
| 110 | 112 |
| 111 #endif // V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ | 113 #endif // V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ |
| OLD | NEW |