Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: test/cctest/test-ast-expression-visitor.cc

Issue 1447133002: Use asm style type names and improve asm typer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: revised Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // return { geometricMean: geometricMean }; 266 // return { geometricMean: geometricMean };
267 CHECK_EXPR(ObjectLiteral, Bounds::Unbounded()) { 267 CHECK_EXPR(ObjectLiteral, Bounds::Unbounded()) {
268 CHECK_VAR(geometricMean, Bounds::Unbounded()); 268 CHECK_VAR(geometricMean, Bounds::Unbounded());
269 } 269 }
270 } 270 }
271 } 271 }
272 CHECK_TYPES_END 272 CHECK_TYPES_END
273 } 273 }
274 274
275 275
276 TEST(VisitConditional) {
277 v8::V8::Initialize();
278 HandleAndZoneScope handles;
279 ZoneVector<ExpressionTypeEntry> types(handles.main_zone());
280 // Check that traversing the ternary operator works.
281 const char test_function[] =
282 "function foo() {\n"
283 " var a, b, c;\n"
284 " var x = a ? b : c;\n"
285 "}\n";
286 CollectTypes(&handles, test_function, &types);
287 CHECK_TYPES_BEGIN {
288 CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) {
289 CHECK_EXPR(Assignment, Bounds::Unbounded()) {
290 CHECK_VAR(x, Bounds::Unbounded());
291 CHECK_EXPR(Conditional, Bounds::Unbounded()) {
292 CHECK_VAR(a, Bounds::Unbounded());
293 CHECK_VAR(b, Bounds::Unbounded());
294 CHECK_VAR(c, Bounds::Unbounded());
295 }
296 }
297 }
298 }
299 CHECK_TYPES_END
300 }
301
302
276 TEST(VisitEmptyForStatment) { 303 TEST(VisitEmptyForStatment) {
277 v8::V8::Initialize(); 304 v8::V8::Initialize();
278 HandleAndZoneScope handles; 305 HandleAndZoneScope handles;
279 ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); 306 ZoneVector<ExpressionTypeEntry> types(handles.main_zone());
280 // Check that traversing an empty for statement works. 307 // Check that traversing an empty for statement works.
281 const char test_function[] = 308 const char test_function[] =
282 "function foo() {\n" 309 "function foo() {\n"
283 " for (;;) {}\n" 310 " for (;;) {}\n"
284 "}\n"; 311 "}\n";
285 CollectTypes(&handles, test_function, &types); 312 CollectTypes(&handles, test_function, &types);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) { 413 CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) {
387 CHECK_EXPR(BinaryOperation, Bounds::Unbounded()) { 414 CHECK_EXPR(BinaryOperation, Bounds::Unbounded()) {
388 // Skip x + x 415 // Skip x + x
389 CHECK_SKIP(); 416 CHECK_SKIP();
390 CHECK_EXPR(Literal, Bounds::Unbounded()); 417 CHECK_EXPR(Literal, Bounds::Unbounded());
391 } 418 }
392 } 419 }
393 } 420 }
394 CHECK_TYPES_END 421 CHECK_TYPES_END
395 } 422 }
OLDNEW
« no previous file with comments | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698