| 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/base/adapters.h" | 7 #include "src/base/adapters.h" |
| 8 #include "src/base/atomic-utils.h" | 8 #include "src/base/atomic-utils.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compiler/wasm-compiler.h" | 10 #include "src/compiler/wasm-compiler.h" |
| (...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 | 1728 |
| 1729 Handle<JSObject> exports_object = instance; | 1729 Handle<JSObject> exports_object = instance; |
| 1730 if (module_->export_table.size() > 0 && module_->origin == kWasmOrigin) { | 1730 if (module_->export_table.size() > 0 && module_->origin == kWasmOrigin) { |
| 1731 // Create the "exports" object. | 1731 // Create the "exports" object. |
| 1732 Handle<JSFunction> object_function = Handle<JSFunction>( | 1732 Handle<JSFunction> object_function = Handle<JSFunction>( |
| 1733 isolate_->native_context()->object_function(), isolate_); | 1733 isolate_->native_context()->object_function(), isolate_); |
| 1734 exports_object = | 1734 exports_object = |
| 1735 isolate_->factory()->NewJSObject(object_function, TENURED); | 1735 isolate_->factory()->NewJSObject(object_function, TENURED); |
| 1736 Handle<String> exports_name = | 1736 Handle<String> exports_name = |
| 1737 isolate_->factory()->InternalizeUtf8String("exports"); | 1737 isolate_->factory()->InternalizeUtf8String("exports"); |
| 1738 JSObject::AddProperty(instance, exports_name, exports_object, READ_ONLY); | 1738 JSObject::AddProperty(instance, exports_name, exports_object, NONE); |
| 1739 } | 1739 } |
| 1740 | 1740 |
| 1741 PropertyDescriptor desc; | 1741 PropertyDescriptor desc; |
| 1742 desc.set_writable(false); | 1742 desc.set_writable(false); |
| 1743 | 1743 |
| 1744 // Count up export indexes. | 1744 // Count up export indexes. |
| 1745 int export_index = 0; | 1745 int export_index = 0; |
| 1746 for (auto exp : module_->export_table) { | 1746 for (auto exp : module_->export_table) { |
| 1747 if (exp.kind == kExternalFunction) { | 1747 if (exp.kind == kExternalFunction) { |
| 1748 ++export_index; | 1748 ++export_index; |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2384 MaybeHandle<String> WasmCompiledModule::GetFunctionName( | 2384 MaybeHandle<String> WasmCompiledModule::GetFunctionName( |
| 2385 Handle<WasmCompiledModule> compiled_module, uint32_t func_index) { | 2385 Handle<WasmCompiledModule> compiled_module, uint32_t func_index) { |
| 2386 DCHECK_LT(func_index, compiled_module->module()->functions.size()); | 2386 DCHECK_LT(func_index, compiled_module->module()->functions.size()); |
| 2387 WasmFunction& function = compiled_module->module()->functions[func_index]; | 2387 WasmFunction& function = compiled_module->module()->functions[func_index]; |
| 2388 Isolate* isolate = compiled_module->GetIsolate(); | 2388 Isolate* isolate = compiled_module->GetIsolate(); |
| 2389 MaybeHandle<String> string = ExtractStringFromModuleBytes( | 2389 MaybeHandle<String> string = ExtractStringFromModuleBytes( |
| 2390 isolate, compiled_module, function.name_offset, function.name_length); | 2390 isolate, compiled_module, function.name_offset, function.name_length); |
| 2391 if (!string.is_null()) return string.ToHandleChecked(); | 2391 if (!string.is_null()) return string.ToHandleChecked(); |
| 2392 return {}; | 2392 return {}; |
| 2393 } | 2393 } |
| OLD | NEW |