| 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 } | 723 } |
| 724 WasmFunction& func = module->functions[func_index]; | 724 WasmFunction& func = module->functions[func_index]; |
| 725 return {static_cast<int>(func.code_start_offset), | 725 return {static_cast<int>(func.code_start_offset), |
| 726 static_cast<int>(func.code_end_offset - func.code_start_offset)}; | 726 static_cast<int>(func.code_end_offset - func.code_start_offset)}; |
| 727 } | 727 } |
| 728 | 728 |
| 729 Handle<Script> CreateWasmScript(Isolate* isolate, | 729 Handle<Script> CreateWasmScript(Isolate* isolate, |
| 730 const ModuleWireBytes& wire_bytes) { | 730 const ModuleWireBytes& wire_bytes) { |
| 731 Handle<Script> script = | 731 Handle<Script> script = |
| 732 isolate->factory()->NewScript(isolate->factory()->empty_string()); | 732 isolate->factory()->NewScript(isolate->factory()->empty_string()); |
| 733 FixedArray* array = isolate->native_context()->embedder_data(); |
| 734 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); |
| 733 script->set_type(Script::TYPE_WASM); | 735 script->set_type(Script::TYPE_WASM); |
| 734 | 736 |
| 735 int hash = StringHasher::HashSequentialString( | 737 int hash = StringHasher::HashSequentialString( |
| 736 reinterpret_cast<const char*>(wire_bytes.module_bytes.start()), | 738 reinterpret_cast<const char*>(wire_bytes.module_bytes.start()), |
| 737 wire_bytes.module_bytes.length(), kZeroHashSeed); | 739 wire_bytes.module_bytes.length(), kZeroHashSeed); |
| 738 | 740 |
| 739 const int kBufferSize = 50; | 741 const int kBufferSize = 50; |
| 740 char buffer[kBufferSize]; | 742 char buffer[kBufferSize]; |
| 741 int url_chars = SNPrintF(ArrayVector(buffer), "wasm://wasm/%08x", hash); | 743 int url_chars = SNPrintF(ArrayVector(buffer), "wasm://wasm/%08x", hash); |
| 742 DCHECK(url_chars >= 0 && url_chars < kBufferSize); | 744 DCHECK(url_chars >= 0 && url_chars < kBufferSize); |
| (...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2564 | 2566 |
| 2565 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), | 2567 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), |
| 2566 NONE); | 2568 NONE); |
| 2567 JSObject::AddProperty(entry, kind_string, export_kind, NONE); | 2569 JSObject::AddProperty(entry, kind_string, export_kind, NONE); |
| 2568 | 2570 |
| 2569 storage->set(index, *entry); | 2571 storage->set(index, *entry); |
| 2570 } | 2572 } |
| 2571 | 2573 |
| 2572 return array_object; | 2574 return array_object; |
| 2573 } | 2575 } |
| OLD | NEW |