| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/debug/debug-evaluate.h" | 8 #include "src/debug/debug-evaluate.h" |
| 9 #include "src/debug/debug-frames.h" | 9 #include "src/debug/debug-frames.h" |
| 10 #include "src/debug/debug-scopes.h" | 10 #include "src/debug/debug-scopes.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 // Get debugger related details for an object property, in the following format: | 324 // Get debugger related details for an object property, in the following format: |
| 325 // 0: Property value | 325 // 0: Property value |
| 326 // 1: Property details | 326 // 1: Property details |
| 327 // 2: Property value is exception | 327 // 2: Property value is exception |
| 328 // 3: Getter function if defined | 328 // 3: Getter function if defined |
| 329 // 4: Setter function if defined | 329 // 4: Setter function if defined |
| 330 // Items 2-4 are only filled if the property has either a getter or a setter. | 330 // Items 2-4 are only filled if the property has either a getter or a setter. |
| 331 RUNTIME_FUNCTION(Runtime_DebugGetPropertyDetails) { | 331 RUNTIME_FUNCTION(Runtime_DebugGetPropertyDetails) { |
| 332 HandleScope scope(isolate); | 332 HandleScope scope(isolate); |
| 333 DCHECK_EQ(2, args.length()); |
| 334 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
| 335 CONVERT_ARG_HANDLE_CHECKED(Object, name_obj, 1); |
| 333 | 336 |
| 334 DCHECK(args.length() == 2); | 337 // Convert the {name_obj} to a Name. |
| 335 | 338 Handle<Name> name; |
| 336 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 339 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, name, |
| 337 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); | 340 Object::ToName(isolate, name_obj)); |
| 338 | 341 |
| 339 // Make sure to set the current context to the context before the debugger was | 342 // Make sure to set the current context to the context before the debugger was |
| 340 // entered (if the debugger is entered). The reason for switching context here | 343 // entered (if the debugger is entered). The reason for switching context here |
| 341 // is that for some property lookups (accessors and interceptors) callbacks | 344 // is that for some property lookups (accessors and interceptors) callbacks |
| 342 // into the embedding application can occour, and the embedding application | 345 // into the embedding application can occour, and the embedding application |
| 343 // could have the assumption that its own native context is the current | 346 // could have the assumption that its own native context is the current |
| 344 // context and not some internal debugger context. | 347 // context and not some internal debugger context. |
| 345 SaveContext save(isolate); | 348 SaveContext save(isolate); |
| 346 if (isolate->debug()->in_debug_scope()) { | 349 if (isolate->debug()->in_debug_scope()) { |
| 347 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); | 350 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); |
| (...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); | 1822 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); |
| 1820 | 1823 |
| 1821 Handle<wasm::WasmDebugInfo> debug_info = | 1824 Handle<wasm::WasmDebugInfo> debug_info = |
| 1822 wasm::GetDebugInfo(handle(script->wasm_object(), isolate)); | 1825 wasm::GetDebugInfo(handle(script->wasm_object(), isolate)); |
| 1823 return *wasm::WasmDebugInfo::DisassembleFunction( | 1826 return *wasm::WasmDebugInfo::DisassembleFunction( |
| 1824 debug_info, script->wasm_function_index()); | 1827 debug_info, script->wasm_function_index()); |
| 1825 } | 1828 } |
| 1826 | 1829 |
| 1827 } // namespace internal | 1830 } // namespace internal |
| 1828 } // namespace v8 | 1831 } // namespace v8 |
| OLD | NEW |