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

Side by Side Diff: src/asmjs/asm-js.cc

Issue 2629523007: [wasm] JS-API: enable WebAssembly.instantiate tests; fix LinkError (Closed)
Patch Set: initialize module_ upfront Created 3 years, 11 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 | src/wasm/wasm-js.cc » ('j') | test/mjsunit/wasm/js-api.js » ('J')
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/asmjs/asm-js.h" 5 #include "src/asmjs/asm-js.h"
6 6
7 #include "src/api-natives.h" 7 #include "src/api-natives.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/asmjs/asm-typer.h" 9 #include "src/asmjs/asm-typer.h"
10 #include "src/asmjs/asm-wasm-builder.h" 10 #include "src/asmjs/asm-wasm-builder.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 247 }
248 return true; 248 return true;
249 } 249 }
250 250
251 MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate, 251 MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate,
252 Handle<FixedArray> wasm_data, 252 Handle<FixedArray> wasm_data,
253 Handle<JSArrayBuffer> memory, 253 Handle<JSArrayBuffer> memory,
254 Handle<JSReceiver> foreign) { 254 Handle<JSReceiver> foreign) {
255 base::ElapsedTimer instantiate_timer; 255 base::ElapsedTimer instantiate_timer;
256 instantiate_timer.Start(); 256 instantiate_timer.Start();
257 i::Handle<i::JSObject> module( 257 i::Handle<i::WasmModuleObject> module(
258 i::JSObject::cast(wasm_data->get(kWasmDataCompiledModule))); 258 i::WasmModuleObject::cast(wasm_data->get(kWasmDataCompiledModule)));
259 i::Handle<i::FixedArray> foreign_globals( 259 i::Handle<i::FixedArray> foreign_globals(
260 i::FixedArray::cast(wasm_data->get(kWasmDataForeignGlobals))); 260 i::FixedArray::cast(wasm_data->get(kWasmDataForeignGlobals)));
261 261
262 ErrorThrower thrower(isolate, "Asm.js -> WebAssembly instantiation"); 262 ErrorThrower thrower(isolate, "Asm.js -> WebAssembly instantiation");
263 263
264 // Create the ffi object for foreign functions {"": foreign}. 264 // Create the ffi object for foreign functions {"": foreign}.
265 Handle<JSObject> ffi_object; 265 Handle<JSObject> ffi_object;
266 if (!foreign.is_null()) { 266 if (!foreign.is_null()) {
267 Handle<JSFunction> object_function = Handle<JSFunction>( 267 Handle<JSFunction> object_function = Handle<JSFunction>(
268 isolate->native_context()->object_function(), isolate); 268 isolate->native_context()->object_function(), isolate);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 isolate, MessageTemplate::kAsmJsInstantiated, &location, stext, 341 isolate, MessageTemplate::kAsmJsInstantiated, &location, stext,
342 Handle<JSArray>::null()); 342 Handle<JSArray>::null());
343 message->set_error_level(v8::Isolate::kMessageInfo); 343 message->set_error_level(v8::Isolate::kMessageInfo);
344 MessageHandler::ReportMessage(isolate, &location, message); 344 MessageHandler::ReportMessage(isolate, &location, message);
345 345
346 return module_object; 346 return module_object;
347 } 347 }
348 348
349 } // namespace internal 349 } // namespace internal
350 } // namespace v8 350 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-js.cc » ('j') | test/mjsunit/wasm/js-api.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698