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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/base/atomic-utils.h" | 9 #include "src/base/atomic-utils.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1977 weak_exported_functions->set(export_index, *weak_export); | 1977 weak_exported_functions->set(export_index, *weak_export); |
1978 break; | 1978 break; |
1979 } | 1979 } |
1980 case kExternalTable: { | 1980 case kExternalTable: { |
1981 // Export a table as a WebAssembly.Table object. | 1981 // Export a table as a WebAssembly.Table object. |
1982 TableInstance& table_instance = table_instances_[exp.index]; | 1982 TableInstance& table_instance = table_instances_[exp.index]; |
1983 WasmIndirectFunctionTable& table = | 1983 WasmIndirectFunctionTable& table = |
1984 module_->function_tables[exp.index]; | 1984 module_->function_tables[exp.index]; |
1985 if (table_instance.table_object.is_null()) { | 1985 if (table_instance.table_object.is_null()) { |
1986 uint32_t maximum = | 1986 uint32_t maximum = |
1987 table.has_max ? table.max_size : kV8MaxWasmTableSize; | 1987 table.has_max ? table.max_size : FLAG_wasm_max_table_size; |
1988 table_instance.table_object = WasmTableObject::New( | 1988 table_instance.table_object = WasmTableObject::New( |
1989 isolate_, table.min_size, maximum, &table_instance.js_wrappers); | 1989 isolate_, table.min_size, maximum, &table_instance.js_wrappers); |
1990 } | 1990 } |
1991 desc.set_value(table_instance.table_object); | 1991 desc.set_value(table_instance.table_object); |
1992 break; | 1992 break; |
1993 } | 1993 } |
1994 case kExternalMemory: { | 1994 case kExternalMemory: { |
1995 // Export the memory as a WebAssembly.Memory object. | 1995 // Export the memory as a WebAssembly.Memory object. |
1996 Handle<WasmMemoryObject> memory_object; | 1996 Handle<WasmMemoryObject> memory_object; |
1997 if (!instance->has_memory_object()) { | 1997 if (!instance->has_memory_object()) { |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2684 | 2684 |
2685 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), | 2685 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), |
2686 NONE); | 2686 NONE); |
2687 JSObject::AddProperty(entry, kind_string, export_kind, NONE); | 2687 JSObject::AddProperty(entry, kind_string, export_kind, NONE); |
2688 | 2688 |
2689 storage->set(index, *entry); | 2689 storage->set(index, *entry); |
2690 } | 2690 } |
2691 | 2691 |
2692 return array_object; | 2692 return array_object; |
2693 } | 2693 } |
OLD | NEW |