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/api-natives.h" | 5 #include "src/api-natives.h" |
6 #include "src/api.h" | 6 #include "src/api.h" |
7 #include "src/asmjs/asm-js.h" | 7 #include "src/asmjs/asm-js.h" |
8 #include "src/asmjs/asm-typer.h" | 8 #include "src/asmjs/asm-typer.h" |
9 #include "src/asmjs/asm-wasm-builder.h" | 9 #include "src/asmjs/asm-wasm-builder.h" |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 v8::ReturnValue<v8::Value> return_value = args.GetReturnValue(); | 325 v8::ReturnValue<v8::Value> return_value = args.GetReturnValue(); |
326 return_value.Set(instance.ToLocalChecked()); | 326 return_value.Set(instance.ToLocalChecked()); |
327 } | 327 } |
328 | 328 |
329 void WebAssemblyInstantiate(const v8::FunctionCallbackInfo<v8::Value>& args) { | 329 void WebAssemblyInstantiate(const v8::FunctionCallbackInfo<v8::Value>& args) { |
330 v8::Isolate* isolate = args.GetIsolate(); | 330 v8::Isolate* isolate = args.GetIsolate(); |
331 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 331 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
332 | 332 |
333 HandleScope scope(isolate); | 333 HandleScope scope(isolate); |
334 ErrorThrower thrower(i_isolate, "WebAssembly.compile()"); | 334 ErrorThrower thrower(i_isolate, "WebAssembly.instantiate()"); |
335 | 335 |
336 Local<Context> context = isolate->GetCurrentContext(); | 336 Local<Context> context = isolate->GetCurrentContext(); |
337 i::Handle<i::Context> i_context = Utils::OpenHandle(*context); | 337 i::Handle<i::Context> i_context = Utils::OpenHandle(*context); |
338 | 338 |
339 v8::Local<v8::Promise::Resolver> resolver; | 339 v8::Local<v8::Promise::Resolver> resolver; |
340 if (!v8::Promise::Resolver::New(context).ToLocal(&resolver)) return; | 340 if (!v8::Promise::Resolver::New(context).ToLocal(&resolver)) return; |
341 v8::ReturnValue<v8::Value> return_value = args.GetReturnValue(); | 341 v8::ReturnValue<v8::Value> return_value = args.GetReturnValue(); |
342 return_value.Set(resolver->GetPromise()); | 342 return_value.Set(resolver->GetPromise()); |
343 | 343 |
344 if (args.Length() < 1) { | 344 if (args.Length() < 1) { |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); | 951 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); |
952 return HasBrand(value, symbol); | 952 return HasBrand(value, symbol); |
953 } | 953 } |
954 | 954 |
955 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { | 955 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { |
956 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); | 956 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); |
957 return HasBrand(value, symbol); | 957 return HasBrand(value, symbol); |
958 } | 958 } |
959 } // namespace internal | 959 } // namespace internal |
960 } // namespace v8 | 960 } // namespace v8 |
OLD | NEW |