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

Unified Diff: src/runtime/runtime-test.cc

Issue 2246483002: [debugger] add mixed-stack tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/ignition/debug-break-mixed-stack.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-test.cc
diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc
index 36d359712e541066ca24dd8c81cece0be4121909..356c6c771720c27116f0784f1412e2b92a91d543 100644
--- a/src/runtime/runtime-test.cc
+++ b/src/runtime/runtime-test.cc
@@ -140,6 +140,46 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
return isolate->heap()->undefined_value();
}
+RUNTIME_FUNCTION(Runtime_InterpretFunctionOnNextCall) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(Object, function_object, 0);
+ if (!function_object->IsJSFunction()) {
+ return isolate->heap()->undefined_value();
+ }
+ Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
+
+ // Do not tier down if we are already on optimized code. Replacing optimized
+ // code without actual deoptimization can lead to funny bugs.
+ if (function->code()->kind() != Code::OPTIMIZED_FUNCTION &&
+ function->shared()->HasBytecodeArray()) {
+ function->ReplaceCode(*isolate->builtins()->InterpreterEntryTrampoline());
+ }
+ return isolate->heap()->undefined_value();
+}
+
+RUNTIME_FUNCTION(Runtime_BaselineFunctionOnNextCall) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(Object, function_object, 0);
+ if (!function_object->IsJSFunction()) {
+ return isolate->heap()->undefined_value();
+ }
+ Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
+
+ // Do not tier down if we are already on optimized code. Replacing optimized
+ // code without actual deoptimization can lead to funny bugs.
+ if (function->code()->kind() != Code::OPTIMIZED_FUNCTION &&
+ function->code()->kind() != Code::FUNCTION) {
+ if (function->shared()->HasBaselineCode()) {
+ function->ReplaceCode(function->shared()->code());
+ } else {
+ function->MarkForBaseline();
+ }
+ }
+
+ return isolate->heap()->undefined_value();
+}
RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
HandleScope scope(isolate);
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/ignition/debug-break-mixed-stack.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698