| 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 9160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9171 | 9171 |
| 9172 debug::WasmDisassembly debug::WasmScript::DisassembleFunction( | 9172 debug::WasmDisassembly debug::WasmScript::DisassembleFunction( |
| 9173 int function_index) const { | 9173 int function_index) const { |
| 9174 i::Handle<i::Script> script = Utils::OpenHandle(this); | 9174 i::Handle<i::Script> script = Utils::OpenHandle(this); |
| 9175 DCHECK_EQ(i::Script::TYPE_WASM, script->type()); | 9175 DCHECK_EQ(i::Script::TYPE_WASM, script->type()); |
| 9176 i::WasmCompiledModule* compiled_module = | 9176 i::WasmCompiledModule* compiled_module = |
| 9177 i::WasmCompiledModule::cast(script->wasm_compiled_module()); | 9177 i::WasmCompiledModule::cast(script->wasm_compiled_module()); |
| 9178 return compiled_module->DisassembleFunction(function_index); | 9178 return compiled_module->DisassembleFunction(function_index); |
| 9179 } | 9179 } |
| 9180 | 9180 |
| 9181 debug::AsyncTaskEventType debug::AsyncTaskEventData::type() const { |
| 9182 i::Handle<i::Tuple3> data = Utils::OpenHandle(this); |
| 9183 return static_cast<debug::AsyncTaskEventType>( |
| 9184 i::Smi::cast(data->value1())->value()); |
| 9185 } |
| 9186 |
| 9187 int debug::AsyncTaskEventData::id() const { |
| 9188 i::Handle<i::Tuple3> data = Utils::OpenHandle(this); |
| 9189 return i::Smi::cast(data->value2())->value(); |
| 9190 } |
| 9191 |
| 9192 MaybeLocal<String> debug::AsyncTaskEventData::name() const { |
| 9193 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 9194 i::HandleScope handle_scope(isolate); |
| 9195 i::Handle<i::Tuple3> data = Utils::OpenHandle(this); |
| 9196 i::Handle<i::Object> value(data->value3(), isolate); |
| 9197 if (!value->IsString()) return MaybeLocal<String>(); |
| 9198 return Utils::ToLocal( |
| 9199 handle_scope.CloseAndEscape(i::Handle<i::String>::cast(value))); |
| 9200 } |
| 9201 |
| 9202 debug::AsyncTaskEventData* debug::AsyncTaskEventData::Cast(Value* value) { |
| 9203 return reinterpret_cast<AsyncTaskEventData*>(value); |
| 9204 } |
| 9205 |
| 9181 debug::Location::Location(int line_number, int column_number) | 9206 debug::Location::Location(int line_number, int column_number) |
| 9182 : line_number_(line_number), column_number_(column_number) { | 9207 : line_number_(line_number), column_number_(column_number) { |
| 9183 CHECK(line_number >= 0); | 9208 CHECK(line_number >= 0); |
| 9184 CHECK(column_number >= 0); | 9209 CHECK(column_number >= 0); |
| 9185 } | 9210 } |
| 9186 | 9211 |
| 9187 debug::Location::Location() : line_number_(-1), column_number_(-1) {} | 9212 debug::Location::Location() : line_number_(-1), column_number_(-1) {} |
| 9188 | 9213 |
| 9189 int debug::Location::GetLineNumber() const { | 9214 int debug::Location::GetLineNumber() const { |
| 9190 CHECK(line_number_ >= 0); | 9215 CHECK(line_number_ >= 0); |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9922 Address callback_address = | 9947 Address callback_address = |
| 9923 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9948 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9924 VMState<EXTERNAL> state(isolate); | 9949 VMState<EXTERNAL> state(isolate); |
| 9925 ExternalCallbackScope call_scope(isolate, callback_address); | 9950 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9926 callback(info); | 9951 callback(info); |
| 9927 } | 9952 } |
| 9928 | 9953 |
| 9929 | 9954 |
| 9930 } // namespace internal | 9955 } // namespace internal |
| 9931 } // namespace v8 | 9956 } // namespace v8 |
| OLD | NEW |