Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1809)

Side by Side Diff: src/api.cc

Issue 2536373007: [wasm] Make DisassembleFunction a method of WasmCompiledModule (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 9118 matching lines...) Expand 10 before | Expand all | Expand 10 after
9129 if (v8_script.IsEmpty()) return {}; 9129 if (v8_script.IsEmpty()) return {};
9130 i::Handle<i::Object> script_wrapper = Utils::OpenHandle(*v8_script); 9130 i::Handle<i::Object> script_wrapper = Utils::OpenHandle(*v8_script);
9131 if (!script_wrapper->IsJSValue()) return {}; 9131 if (!script_wrapper->IsJSValue()) return {};
9132 i::Handle<i::Object> script_obj( 9132 i::Handle<i::Object> script_obj(
9133 i::Handle<i::JSValue>::cast(script_wrapper)->value(), isolate); 9133 i::Handle<i::JSValue>::cast(script_wrapper)->value(), isolate);
9134 if (!script_obj->IsScript()) return {}; 9134 if (!script_obj->IsScript()) return {};
9135 i::Handle<i::Script> script = i::Handle<i::Script>::cast(script_obj); 9135 i::Handle<i::Script> script = i::Handle<i::Script>::cast(script_obj);
9136 if (script->type() != i::Script::TYPE_WASM) return {}; 9136 if (script->type() != i::Script::TYPE_WASM) return {};
9137 i::Handle<i::WasmCompiledModule> compiled_module( 9137 i::Handle<i::WasmCompiledModule> compiled_module(
9138 i::WasmCompiledModule::cast(script->wasm_compiled_module()), isolate); 9138 i::WasmCompiledModule::cast(script->wasm_compiled_module()), isolate);
9139 return i::wasm::DisassembleFunction(compiled_module, function_index); 9139 return compiled_module->DisassembleFunction(function_index);
9140 } 9140 }
9141 9141
9142 MaybeLocal<UnboundScript> DebugInterface::CompileInspectorScript( 9142 MaybeLocal<UnboundScript> DebugInterface::CompileInspectorScript(
9143 Isolate* v8_isolate, Local<String> source) { 9143 Isolate* v8_isolate, Local<String> source) {
9144 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); 9144 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
9145 PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(isolate, UnboundScript); 9145 PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(isolate, UnboundScript);
9146 i::ScriptData* script_data = NULL; 9146 i::ScriptData* script_data = NULL;
9147 i::Handle<i::String> str = Utils::OpenHandle(*source); 9147 i::Handle<i::String> str = Utils::OpenHandle(*source);
9148 i::Handle<i::SharedFunctionInfo> result; 9148 i::Handle<i::SharedFunctionInfo> result;
9149 { 9149 {
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
9839 Address callback_address = 9839 Address callback_address =
9840 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9840 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9841 VMState<EXTERNAL> state(isolate); 9841 VMState<EXTERNAL> state(isolate);
9842 ExternalCallbackScope call_scope(isolate, callback_address); 9842 ExternalCallbackScope call_scope(isolate, callback_address);
9843 callback(info); 9843 callback(info);
9844 } 9844 }
9845 9845
9846 9846
9847 } // namespace internal 9847 } // namespace internal
9848 } // namespace v8 9848 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698