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

Side by Side Diff: test/cctest/expression-type-collector.cc

Issue 2146853004: [wasm] Drop old typing-asm and its tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months 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/expression-type-collector.h ('k') | test/cctest/test-ast-expression-visitor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "src/v8.h"
6
7 #include "test/cctest/expression-type-collector.h"
8
9 #include "src/ast/ast-type-bounds.h"
10 #include "src/ast/ast.h"
11 #include "src/ast/scopes.h"
12 #include "src/codegen.h"
13
14 namespace v8 {
15 namespace internal {
16 namespace {
17
18 struct {
19 AstNode::NodeType type;
20 const char* name;
21 } NodeTypeNameList[] = {
22 #define DECLARE_VISIT(type) \
23 { AstNode::k##type, #type } \
24 ,
25 AST_NODE_LIST(DECLARE_VISIT)
26 #undef DECLARE_VISIT
27 };
28
29 } // namespace
30
31 ExpressionTypeCollector::ExpressionTypeCollector(
32 Isolate* isolate, FunctionLiteral* root, const AstTypeBounds* bounds,
33 ZoneVector<ExpressionTypeEntry>* dst)
34 : AstExpressionVisitor(isolate, root), bounds_(bounds), result_(dst) {}
35
36 void ExpressionTypeCollector::Run() {
37 result_->clear();
38 AstExpressionVisitor::Run();
39 }
40
41
42 void ExpressionTypeCollector::VisitExpression(Expression* expression) {
43 ExpressionTypeEntry e;
44 e.depth = depth();
45 VariableProxy* proxy = expression->AsVariableProxy();
46 if (proxy) {
47 e.name = proxy->raw_name();
48 }
49 e.bounds = bounds_->get(expression);
50 AstNode::NodeType type = expression->node_type();
51 e.kind = "unknown";
52 for (size_t i = 0; i < arraysize(NodeTypeNameList); ++i) {
53 if (NodeTypeNameList[i].type == type) {
54 e.kind = NodeTypeNameList[i].name;
55 break;
56 }
57 }
58 result_->push_back(e);
59 }
60
61 } // namespace internal
62 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/expression-type-collector.h ('k') | test/cctest/test-ast-expression-visitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698