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

Side by Side Diff: test/cctest/asmjs/test-asm-typer.cc

Issue 2398023002: [wasm] asm.js - Parse and convert asm.js to wasm a function at a time. (Closed)
Patch Set: fix Created 4 years 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 | « src/wasm/wasm-module-builder.cc ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 <cstring> 5 #include <cstring>
6 #include <functional> 6 #include <functional>
7 #include <iostream> 7 #include <iostream>
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/asmjs/asm-typer.h" 10 #include "src/asmjs/asm-typer.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 AsmTyperHarnessBuilder* WithUndefinedGlobal( 121 AsmTyperHarnessBuilder* WithUndefinedGlobal(
122 VariableName var_name, std::function<AsmType*(Zone*)> type_creator) { 122 VariableName var_name, std::function<AsmType*(Zone*)> type_creator) {
123 auto* type = type_creator(zone_); 123 auto* type = type_creator(zone_);
124 CHECK(type->AsFunctionType() != nullptr || 124 CHECK(type->AsFunctionType() != nullptr ||
125 type->AsFunctionTableType() != nullptr); 125 type->AsFunctionTableType() != nullptr);
126 WithGlobal(var_name, type); 126 WithGlobal(var_name, type);
127 auto* var_info = typer_->Lookup(DeclareVariable(var_name)); 127 auto* var_info = typer_->Lookup(DeclareVariable(var_name));
128 CHECK(var_info); 128 CHECK(var_info);
129 var_info->FirstForwardUseIs(nullptr); 129 var_info->SetFirstForwardUse(-1);
130 return this; 130 return this;
131 } 131 }
132 132
133 AsmTyperHarnessBuilder* WithImport(VariableName var_name, 133 AsmTyperHarnessBuilder* WithImport(VariableName var_name,
134 AsmTyper::StandardMember standard_member) { 134 AsmTyper::StandardMember standard_member) {
135 auto* var = DeclareVariable(var_name); 135 auto* var = DeclareVariable(var_name);
136 AsmTyper::VariableInfo* var_info = nullptr; 136 AsmTyper::VariableInfo* var_info = nullptr;
137 auto* stdlib_map = &typer_->stdlib_math_types_; 137 auto* stdlib_map = &typer_->stdlib_math_types_;
138 switch (standard_member) { 138 switch (standard_member) {
139 case AsmTyper::kHeap: 139 case AsmTyper::kHeap:
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 if (!ValidationOf(Module(kTests[ii])) 2049 if (!ValidationOf(Module(kTests[ii]))
2050 ->FailsWithMessage( 2050 ->FailsWithMessage(
2051 "Constant in return must be signed, float, or double.")) { 2051 "Constant in return must be signed, float, or double.")) {
2052 std::cerr << "Test:\n" << kTests[ii]; 2052 std::cerr << "Test:\n" << kTests[ii];
2053 CHECK(false); 2053 CHECK(false);
2054 } 2054 }
2055 } 2055 }
2056 } 2056 }
2057 2057
2058 } // namespace 2058 } // namespace
OLDNEW
« no previous file with comments | « src/wasm/wasm-module-builder.cc ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698