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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 memory_constructor, DONT_ENUM); | 692 memory_constructor, DONT_ENUM); |
693 InstallFunc(isolate, memory_proto, "grow", WebAssemblyMemoryGrow); | 693 InstallFunc(isolate, memory_proto, "grow", WebAssemblyMemoryGrow); |
694 InstallGetter(isolate, memory_proto, "buffer", WebAssemblyMemoryGetBuffer); | 694 InstallGetter(isolate, memory_proto, "buffer", WebAssemblyMemoryGetBuffer); |
695 | 695 |
696 // Setup errors | 696 // Setup errors |
697 attributes = static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); | 697 attributes = static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); |
698 Handle<JSFunction> compile_error( | 698 Handle<JSFunction> compile_error( |
699 isolate->native_context()->wasm_compile_error_function()); | 699 isolate->native_context()->wasm_compile_error_function()); |
700 JSObject::AddProperty(webassembly, isolate->factory()->CompileError_string(), | 700 JSObject::AddProperty(webassembly, isolate->factory()->CompileError_string(), |
701 compile_error, attributes); | 701 compile_error, attributes); |
| 702 Handle<JSFunction> link_error( |
| 703 isolate->native_context()->wasm_link_error_function()); |
| 704 JSObject::AddProperty(webassembly, isolate->factory()->LinkError_string(), |
| 705 link_error, attributes); |
702 Handle<JSFunction> runtime_error( | 706 Handle<JSFunction> runtime_error( |
703 isolate->native_context()->wasm_runtime_error_function()); | 707 isolate->native_context()->wasm_runtime_error_function()); |
704 JSObject::AddProperty(webassembly, isolate->factory()->RuntimeError_string(), | 708 JSObject::AddProperty(webassembly, isolate->factory()->RuntimeError_string(), |
705 runtime_error, attributes); | 709 runtime_error, attributes); |
706 } | 710 } |
707 | 711 |
708 void WasmJs::Install(Isolate* isolate, Handle<JSGlobalObject> global) { | 712 void WasmJs::Install(Isolate* isolate, Handle<JSGlobalObject> global) { |
709 if (!FLAG_expose_wasm && !FLAG_validate_asm) { | 713 if (!FLAG_expose_wasm && !FLAG_validate_asm) { |
710 return; | 714 return; |
711 } | 715 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); | 766 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); |
763 return HasBrand(value, symbol); | 767 return HasBrand(value, symbol); |
764 } | 768 } |
765 | 769 |
766 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { | 770 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { |
767 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); | 771 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); |
768 return HasBrand(value, symbol); | 772 return HasBrand(value, symbol); |
769 } | 773 } |
770 } // namespace internal | 774 } // namespace internal |
771 } // namespace v8 | 775 } // namespace v8 |
OLD | NEW |