| 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 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/ast-expression-visitor.h" | 10 #include "src/ast-expression-visitor.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 info.set_allow_lazy_parsing(false); | 38 info.set_allow_lazy_parsing(false); |
| 39 info.set_toplevel(true); | 39 info.set_toplevel(true); |
| 40 | 40 |
| 41 CHECK(i::Compiler::ParseAndAnalyze(&info)); | 41 CHECK(i::Compiler::ParseAndAnalyze(&info)); |
| 42 | 42 |
| 43 ExpressionTypeCollector( | 43 ExpressionTypeCollector( |
| 44 isolate, handles->main_zone(), | 44 isolate, handles->main_zone(), |
| 45 info.scope()->declarations()->at(0)->AsFunctionDeclaration()->fun(), dst) | 45 info.scope()->declarations()->at(0)->AsFunctionDeclaration()->fun(), dst) |
| 46 .Run(); | 46 .Run(); |
| 47 } | 47 } |
| 48 } | 48 |
| 49 } // namespace |
| 49 | 50 |
| 50 | 51 |
| 51 TEST(VisitExpressions) { | 52 TEST(VisitExpressions) { |
| 52 v8::V8::Initialize(); | 53 v8::V8::Initialize(); |
| 53 HandleAndZoneScope handles; | 54 HandleAndZoneScope handles; |
| 54 ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); | 55 ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); |
| 55 const char test_function[] = | 56 const char test_function[] = |
| 56 "function GeometricMean(stdlib, foreign, buffer) {\n" | 57 "function GeometricMean(stdlib, foreign, buffer) {\n" |
| 57 " \"use asm\";\n" | 58 " \"use asm\";\n" |
| 58 "\n" | 59 "\n" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) { | 384 CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) { |
| 384 CHECK_EXPR(BinaryOperation, Bounds::Unbounded()) { | 385 CHECK_EXPR(BinaryOperation, Bounds::Unbounded()) { |
| 385 // Skip x + x | 386 // Skip x + x |
| 386 CHECK_SKIP(); | 387 CHECK_SKIP(); |
| 387 CHECK_EXPR(Literal, Bounds::Unbounded()); | 388 CHECK_EXPR(Literal, Bounds::Unbounded()); |
| 388 } | 389 } |
| 389 } | 390 } |
| 390 } | 391 } |
| 391 CHECK_TYPES_END | 392 CHECK_TYPES_END |
| 392 } | 393 } |
| OLD | NEW |