| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |