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 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 | 1591 |
1592 if (found.is_null()) return isolate->heap()->undefined_value(); | 1592 if (found.is_null()) return isolate->heap()->undefined_value(); |
1593 return *Script::GetWrapper(found); | 1593 return *Script::GetWrapper(found); |
1594 } | 1594 } |
1595 | 1595 |
1596 | 1596 |
1597 // Set one shot breakpoints for the callback function that is passed to a | 1597 // Set one shot breakpoints for the callback function that is passed to a |
1598 // built-in function such as Array.forEach to enable stepping into the callback, | 1598 // built-in function such as Array.forEach to enable stepping into the callback, |
1599 // if we are indeed stepping and the callback is subject to debugging. | 1599 // if we are indeed stepping and the callback is subject to debugging. |
1600 RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) { | 1600 RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) { |
1601 DCHECK(args.length() == 1); | |
1602 HandleScope scope(isolate); | 1601 HandleScope scope(isolate); |
1603 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 1602 DCHECK_EQ(1, args.length()); |
1604 RUNTIME_ASSERT(object->IsJSFunction() || object->IsJSGeneratorObject()); | 1603 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
1605 Handle<JSFunction> fun; | |
1606 if (object->IsJSFunction()) { | |
1607 fun = Handle<JSFunction>::cast(object); | |
1608 } else { | |
1609 fun = Handle<JSFunction>( | |
1610 Handle<JSGeneratorObject>::cast(object)->function(), isolate); | |
1611 } | |
1612 | |
1613 isolate->debug()->PrepareStepIn(fun); | 1604 isolate->debug()->PrepareStepIn(fun); |
1614 return isolate->heap()->undefined_value(); | 1605 return isolate->heap()->undefined_value(); |
1615 } | 1606 } |
1616 | 1607 |
1617 | 1608 |
1618 RUNTIME_FUNCTION(Runtime_DebugPushPromise) { | 1609 RUNTIME_FUNCTION(Runtime_DebugPushPromise) { |
1619 DCHECK(args.length() == 2); | 1610 DCHECK(args.length() == 2); |
1620 HandleScope scope(isolate); | 1611 HandleScope scope(isolate); |
1621 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | 1612 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
1622 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 1); | 1613 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 1); |
(...skipping 26 matching lines...) Expand all Loading... |
1649 return Smi::FromInt(isolate->debug()->is_active()); | 1640 return Smi::FromInt(isolate->debug()->is_active()); |
1650 } | 1641 } |
1651 | 1642 |
1652 | 1643 |
1653 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1644 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
1654 UNIMPLEMENTED(); | 1645 UNIMPLEMENTED(); |
1655 return NULL; | 1646 return NULL; |
1656 } | 1647 } |
1657 } // namespace internal | 1648 } // namespace internal |
1658 } // namespace v8 | 1649 } // namespace v8 |
OLD | NEW |