| OLD | NEW | 
|---|
| 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 9092 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 9103       if (script->type() != i::Script::TYPE_NORMAL) continue; | 9103       if (script->type() != i::Script::TYPE_NORMAL) continue; | 
| 9104       if (script->HasValidSource()) { | 9104       if (script->HasValidSource()) { | 
| 9105         i::HandleScope handle_scope(isolate); | 9105         i::HandleScope handle_scope(isolate); | 
| 9106         i::Handle<i::Script> script_handle(script, isolate); | 9106         i::Handle<i::Script> script_handle(script, isolate); | 
| 9107         scripts.Append(ToApiHandle<Script>(script_handle)); | 9107         scripts.Append(ToApiHandle<Script>(script_handle)); | 
| 9108       } | 9108       } | 
| 9109     } | 9109     } | 
| 9110   } | 9110   } | 
| 9111 } | 9111 } | 
| 9112 | 9112 | 
| 9113 std::pair<std::string, std::vector<std::tuple<uint32_t, int, int>>> | 9113 DebugInterface::WasmDisassembly DebugInterface::DisassembleWasmFunction( | 
| 9114 DebugInterface::DisassembleWasmFunction(Isolate* v8_isolate, | 9114     Isolate* v8_isolate, Local<Object> v8_script, int function_index) { | 
| 9115                                         Local<Object> v8_script, |  | 
| 9116                                         int function_index) { |  | 
| 9117   i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 9115   i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 
| 9118   if (v8_script.IsEmpty()) return {}; | 9116   if (v8_script.IsEmpty()) return {}; | 
| 9119   i::Handle<i::Object> script_wrapper = Utils::OpenHandle(*v8_script); | 9117   i::Handle<i::Object> script_wrapper = Utils::OpenHandle(*v8_script); | 
| 9120   if (!script_wrapper->IsJSValue()) return {}; | 9118   if (!script_wrapper->IsJSValue()) return {}; | 
| 9121   i::Handle<i::Object> script_obj( | 9119   i::Handle<i::Object> script_obj( | 
| 9122       i::Handle<i::JSValue>::cast(script_wrapper)->value(), isolate); | 9120       i::Handle<i::JSValue>::cast(script_wrapper)->value(), isolate); | 
| 9123   if (!script_obj->IsScript()) return {}; | 9121   if (!script_obj->IsScript()) return {}; | 
| 9124   i::Handle<i::Script> script = i::Handle<i::Script>::cast(script_obj); | 9122   i::Handle<i::Script> script = i::Handle<i::Script>::cast(script_obj); | 
| 9125   if (script->type() != i::Script::TYPE_WASM) return {}; | 9123   if (script->type() != i::Script::TYPE_WASM) return {}; | 
| 9126   i::Handle<i::WasmCompiledModule> compiled_module( | 9124   i::Handle<i::WasmCompiledModule> compiled_module( | 
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 9828   Address callback_address = | 9826   Address callback_address = | 
| 9829       reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9827       reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 
| 9830   VMState<EXTERNAL> state(isolate); | 9828   VMState<EXTERNAL> state(isolate); | 
| 9831   ExternalCallbackScope call_scope(isolate, callback_address); | 9829   ExternalCallbackScope call_scope(isolate, callback_address); | 
| 9832   callback(info); | 9830   callback(info); | 
| 9833 } | 9831 } | 
| 9834 | 9832 | 
| 9835 | 9833 | 
| 9836 }  // namespace internal | 9834 }  // namespace internal | 
| 9837 }  // namespace v8 | 9835 }  // namespace v8 | 
| OLD | NEW | 
|---|