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 // TODO(jochen): Remove this after the setting is turned on globally. | 5 // TODO(jochen): Remove this after the setting is turned on globally. |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 | 170 |
171 template <int N, typename T = Handle<Object>> | 171 template <int N, typename T = Handle<Object>> |
172 struct ExpectedSnippet { | 172 struct ExpectedSnippet { |
173 const char* code_snippet; | 173 const char* code_snippet; |
174 T return_value_and_parameters[N + 1]; | 174 T return_value_and_parameters[N + 1]; |
175 | 175 |
176 inline T return_value() const { return return_value_and_parameters[0]; } | 176 inline T return_value() const { return return_value_and_parameters[0]; } |
177 | 177 |
178 inline T parameter(int i) const { | 178 inline T parameter(int i) const { |
179 DCHECK_GE(i, 0); | 179 CHECK_GE(i, 0); |
180 DCHECK_LT(i, N); | 180 CHECK_LT(i, N); |
181 return return_value_and_parameters[1 + i]; | 181 return return_value_and_parameters[1 + i]; |
182 } | 182 } |
183 }; | 183 }; |
184 | 184 |
185 | 185 |
186 TEST(BytecodeGraphBuilderReturnStatements) { | 186 TEST(BytecodeGraphBuilderReturnStatements) { |
187 HandleAndZoneScope scope; | 187 HandleAndZoneScope scope; |
188 Isolate* isolate = scope.main_isolate(); | 188 Isolate* isolate = scope.main_isolate(); |
189 Zone* zone = scope.main_zone(); | 189 Zone* zone = scope.main_zone(); |
190 Factory* factory = isolate->factory(); | 190 Factory* factory = isolate->factory(); |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 auto callable = tester.GetCallable<Handle<Object>>("f"); | 1182 auto callable = tester.GetCallable<Handle<Object>>("f"); |
1183 Handle<Object> return_value = | 1183 Handle<Object> return_value = |
1184 callable(snippets[i].parameter(0)).ToHandleChecked(); | 1184 callable(snippets[i].parameter(0)).ToHandleChecked(); |
1185 CHECK(return_value->SameValue(*snippets[i].return_value())); | 1185 CHECK(return_value->SameValue(*snippets[i].return_value())); |
1186 } | 1186 } |
1187 } | 1187 } |
1188 | 1188 |
1189 } // namespace compiler | 1189 } // namespace compiler |
1190 } // namespace internal | 1190 } // namespace internal |
1191 } // namespace v8 | 1191 } // namespace v8 |
OLD | NEW |