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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 } | 710 } |
711 WasmFunction& func = module->functions[func_index]; | 711 WasmFunction& func = module->functions[func_index]; |
712 return {static_cast<int>(func.code_start_offset), | 712 return {static_cast<int>(func.code_start_offset), |
713 static_cast<int>(func.code_end_offset - func.code_start_offset)}; | 713 static_cast<int>(func.code_end_offset - func.code_start_offset)}; |
714 } | 714 } |
715 | 715 |
716 Handle<Script> CreateWasmScript(Isolate* isolate, | 716 Handle<Script> CreateWasmScript(Isolate* isolate, |
717 const ModuleWireBytes& wire_bytes) { | 717 const ModuleWireBytes& wire_bytes) { |
718 Handle<Script> script = | 718 Handle<Script> script = |
719 isolate->factory()->NewScript(isolate->factory()->empty_string()); | 719 isolate->factory()->NewScript(isolate->factory()->empty_string()); |
| 720 FixedArray* array = isolate->native_context()->embedder_data(); |
| 721 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); |
720 script->set_type(Script::TYPE_WASM); | 722 script->set_type(Script::TYPE_WASM); |
721 | 723 |
722 int hash = StringHasher::HashSequentialString( | 724 int hash = StringHasher::HashSequentialString( |
723 reinterpret_cast<const char*>(wire_bytes.module_bytes.start()), | 725 reinterpret_cast<const char*>(wire_bytes.module_bytes.start()), |
724 wire_bytes.module_bytes.length(), kZeroHashSeed); | 726 wire_bytes.module_bytes.length(), kZeroHashSeed); |
725 | 727 |
726 const int kBufferSize = 50; | 728 const int kBufferSize = 50; |
727 char buffer[kBufferSize]; | 729 char buffer[kBufferSize]; |
728 int url_chars = SNPrintF(ArrayVector(buffer), "wasm://wasm/%08x", hash); | 730 int url_chars = SNPrintF(ArrayVector(buffer), "wasm://wasm/%08x", hash); |
729 DCHECK(url_chars >= 0 && url_chars < kBufferSize); | 731 DCHECK(url_chars >= 0 && url_chars < kBufferSize); |
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2506 | 2508 |
2507 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), | 2509 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), |
2508 NONE); | 2510 NONE); |
2509 JSObject::AddProperty(entry, kind_string, export_kind, NONE); | 2511 JSObject::AddProperty(entry, kind_string, export_kind, NONE); |
2510 | 2512 |
2511 storage->set(index, *entry); | 2513 storage->set(index, *entry); |
2512 } | 2514 } |
2513 | 2515 |
2514 return array_object; | 2516 return array_object; |
2515 } | 2517 } |
OLD | NEW |