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

Side by Side Diff: src/runtime/runtime-debug.cc

Issue 2622863003: [debugger] infrastructure for side-effect-free debug-evaluate. (Closed)
Patch Set: clean ups. Created 3 years, 11 months 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
OLDNEW
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/compiler.h"
8 #include "src/debug/debug-evaluate.h" 9 #include "src/debug/debug-evaluate.h"
9 #include "src/debug/debug-frames.h" 10 #include "src/debug/debug-frames.h"
10 #include "src/debug/debug-scopes.h" 11 #include "src/debug/debug-scopes.h"
11 #include "src/debug/debug.h" 12 #include "src/debug/debug.h"
12 #include "src/debug/liveedit.h" 13 #include "src/debug/liveedit.h"
13 #include "src/frames-inl.h" 14 #include "src/frames-inl.h"
14 #include "src/globals.h" 15 #include "src/globals.h"
15 #include "src/interpreter/bytecodes.h" 16 #include "src/interpreter/bytecodes.h"
16 #include "src/interpreter/interpreter.h" 17 #include "src/interpreter/interpreter.h"
17 #include "src/isolate-inl.h" 18 #include "src/isolate-inl.h"
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 (line == 0) ? 0 : Smi::cast(line_ends_array->get(line - 1))->value() + 1; 1840 (line == 0) ? 0 : Smi::cast(line_ends_array->get(line - 1))->value() + 1;
1840 const int end = Smi::cast(line_ends_array->get(line))->value(); 1841 const int end = Smi::cast(line_ends_array->get(line))->value();
1841 1842
1842 Handle<String> source = 1843 Handle<String> source =
1843 handle(String::cast(script_handle->source()), isolate); 1844 handle(String::cast(script_handle->source()), isolate);
1844 Handle<String> str = isolate->factory()->NewSubString(source, start, end); 1845 Handle<String> str = isolate->factory()->NewSubString(source, start, end);
1845 1846
1846 return *str; 1847 return *str;
1847 } 1848 }
1848 1849
1849 // Set one shot breakpoints for the callback function that is passed to a 1850 // Perform %DebugPrepareStepInIfStepping and a read-only check.
jgruber 2017/01/11 16:12:39 This comment is out of date.
Yang 2017/01/12 06:04:51 Done.
1850 // built-in function such as Array.forEach to enable stepping into the callback, 1851 RUNTIME_FUNCTION(Runtime_DebugOnFunctionCall) {
1851 // if we are indeed stepping and the callback is subject to debugging.
1852 RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
1853 HandleScope scope(isolate); 1852 HandleScope scope(isolate);
1854 DCHECK_EQ(1, args.length()); 1853 DCHECK_EQ(1, args.length());
1855 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 1854 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
1856 isolate->debug()->PrepareStepIn(fun); 1855 if (isolate->debug()->last_step_action() >= StepIn) {
1856 isolate->debug()->PrepareStepIn(fun);
1857 }
1858 if (isolate->needs_side_effect_check() &&
1859 !isolate->debug()->PerformSideEffectCheck(fun)) {
1860 return isolate->heap()->exception();
1861 }
1857 return isolate->heap()->undefined_value(); 1862 return isolate->heap()->undefined_value();
1858 } 1863 }
1859 1864
1860 // Set one shot breakpoints for the suspended generator object. 1865 // Set one shot breakpoints for the suspended generator object.
1861 RUNTIME_FUNCTION(Runtime_DebugPrepareStepInSuspendedGenerator) { 1866 RUNTIME_FUNCTION(Runtime_DebugPrepareStepInSuspendedGenerator) {
1862 HandleScope scope(isolate); 1867 HandleScope scope(isolate);
1863 DCHECK_EQ(0, args.length()); 1868 DCHECK_EQ(0, args.length());
1864 isolate->debug()->PrepareStepInSuspendedGenerator(); 1869 isolate->debug()->PrepareStepInSuspendedGenerator();
1865 return isolate->heap()->undefined_value(); 1870 return isolate->heap()->undefined_value();
1866 } 1871 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 } 1920 }
1916 1921
1917 1922
1918 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 1923 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
1919 UNIMPLEMENTED(); 1924 UNIMPLEMENTED();
1920 return NULL; 1925 return NULL;
1921 } 1926 }
1922 1927
1923 } // namespace internal 1928 } // namespace internal
1924 } // namespace v8 1929 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698