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

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 2291043002: [wasm] Use the native_context for the TypeError in ToJS() (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | test/mjsunit/wasm/ffi-error.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 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 "src/compiler/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 10
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after
2190 value = graph()->NewNode(common->Phi(MachineRepresentation::kTagged, 2), vsmi, 2190 value = graph()->NewNode(common->Phi(MachineRepresentation::kTagged, 2), vsmi,
2191 vbox, control); 2191 vbox, control);
2192 return value; 2192 return value;
2193 } 2193 }
2194 2194
2195 Node* WasmGraphBuilder::ToJS(Node* node, wasm::LocalType type) { 2195 Node* WasmGraphBuilder::ToJS(Node* node, wasm::LocalType type) {
2196 switch (type) { 2196 switch (type) {
2197 case wasm::kAstI32: 2197 case wasm::kAstI32:
2198 return BuildChangeInt32ToTagged(node); 2198 return BuildChangeInt32ToTagged(node);
2199 case wasm::kAstI64: 2199 case wasm::kAstI64:
2200 DCHECK(module_ && !module_->instance->context.is_null()); 2200 // Throw a TypeError. The native context is good enough here because we
2201 // Throw a TypeError. 2201 // only throw a TypeError.
2202 return BuildCallToRuntime(Runtime::kWasmThrowTypeError, jsgraph(), 2202 return BuildCallToRuntime(Runtime::kWasmThrowTypeError, jsgraph(),
2203 module_->instance->context, nullptr, 0, effect_, 2203 jsgraph()->isolate()->native_context(), nullptr,
2204 *control_); 2204 0, effect_, *control_);
2205 case wasm::kAstF32: 2205 case wasm::kAstF32:
2206 node = graph()->NewNode(jsgraph()->machine()->ChangeFloat32ToFloat64(), 2206 node = graph()->NewNode(jsgraph()->machine()->ChangeFloat32ToFloat64(),
2207 node); 2207 node);
2208 return BuildChangeFloat64ToTagged(node); 2208 return BuildChangeFloat64ToTagged(node);
2209 case wasm::kAstF64: 2209 case wasm::kAstF64:
2210 return BuildChangeFloat64ToTagged(node); 2210 return BuildChangeFloat64ToTagged(node);
2211 case wasm::kAstStmt: 2211 case wasm::kAstStmt:
2212 return jsgraph()->UndefinedConstant(); 2212 return jsgraph()->UndefinedConstant();
2213 default: 2213 default:
2214 UNREACHABLE(); 2214 UNREACHABLE();
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
3236 function_->code_start_offset), 3236 function_->code_start_offset),
3237 compile_ms); 3237 compile_ms);
3238 } 3238 }
3239 3239
3240 return code; 3240 return code;
3241 } 3241 }
3242 3242
3243 } // namespace compiler 3243 } // namespace compiler
3244 } // namespace internal 3244 } // namespace internal
3245 } // namespace v8 3245 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/wasm/ffi-error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698