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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 } | 718 } |
719 WasmFunction& func = module->functions[func_index]; | 719 WasmFunction& func = module->functions[func_index]; |
720 return {static_cast<int>(func.code_start_offset), | 720 return {static_cast<int>(func.code_start_offset), |
721 static_cast<int>(func.code_end_offset - func.code_start_offset)}; | 721 static_cast<int>(func.code_end_offset - func.code_start_offset)}; |
722 } | 722 } |
723 | 723 |
724 Handle<Script> CreateWasmScript(Isolate* isolate, | 724 Handle<Script> CreateWasmScript(Isolate* isolate, |
725 const ModuleWireBytes& wire_bytes) { | 725 const ModuleWireBytes& wire_bytes) { |
726 Handle<Script> script = | 726 Handle<Script> script = |
727 isolate->factory()->NewScript(isolate->factory()->empty_string()); | 727 isolate->factory()->NewScript(isolate->factory()->empty_string()); |
| 728 FixedArray* array = isolate->native_context()->embedder_data(); |
| 729 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); |
728 script->set_type(Script::TYPE_WASM); | 730 script->set_type(Script::TYPE_WASM); |
729 | 731 |
730 int hash = StringHasher::HashSequentialString( | 732 int hash = StringHasher::HashSequentialString( |
731 reinterpret_cast<const char*>(wire_bytes.module_bytes.start()), | 733 reinterpret_cast<const char*>(wire_bytes.module_bytes.start()), |
732 wire_bytes.module_bytes.length(), kZeroHashSeed); | 734 wire_bytes.module_bytes.length(), kZeroHashSeed); |
733 | 735 |
734 const int kBufferSize = 50; | 736 const int kBufferSize = 50; |
735 char buffer[kBufferSize]; | 737 char buffer[kBufferSize]; |
736 int url_chars = SNPrintF(ArrayVector(buffer), "wasm://wasm/%08x", hash); | 738 int url_chars = SNPrintF(ArrayVector(buffer), "wasm://wasm/%08x", hash); |
737 DCHECK(url_chars >= 0 && url_chars < kBufferSize); | 739 DCHECK(url_chars >= 0 && url_chars < kBufferSize); |
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2626 | 2628 |
2627 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), | 2629 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), |
2628 NONE); | 2630 NONE); |
2629 JSObject::AddProperty(entry, kind_string, export_kind, NONE); | 2631 JSObject::AddProperty(entry, kind_string, export_kind, NONE); |
2630 | 2632 |
2631 storage->set(index, *entry); | 2633 storage->set(index, *entry); |
2632 } | 2634 } |
2633 | 2635 |
2634 return array_object; | 2636 return array_object; |
2635 } | 2637 } |
OLD | NEW |