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

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

Issue 2188713002: [runtime] Fix stack frame iteration in test methods. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | 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 4149b7891c41618cec845e83de5c331686b5d97b..2232b190599a2b1a3025ea72bb44ef23596130ce 100644
--- a/src/runtime/runtime-test.cc
+++ b/src/runtime/runtime-test.cc
@@ -37,6 +37,7 @@ RUNTIME_FUNCTION(Runtime_DeoptimizeFunction) {
}
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
+ // If the function is not optimized, just return.
if (!function->IsOptimized()) return isolate->heap()->undefined_value();
// TODO(turbofan): Deoptimization is not supported yet.
@@ -57,17 +58,12 @@ RUNTIME_FUNCTION(Runtime_DeoptimizeNow) {
Handle<JSFunction> function;
- // If the argument is 'undefined', deoptimize the topmost
- // function.
+ // Find the JavaScript function on the top of the stack.
JavaScriptFrameIterator it(isolate);
- while (!it.done()) {
- if (it.frame()->is_java_script()) {
- function = Handle<JSFunction>(it.frame()->function());
- break;
- }
- }
+ if (!it.done()) function = Handle<JSFunction>(it.frame()->function());
if (function.is_null()) return isolate->heap()->undefined_value();
+ // If the function is not optimized, just return.
if (!function->IsOptimized()) return isolate->heap()->undefined_value();
// TODO(turbofan): Deoptimization is not supported yet.
@@ -155,12 +151,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
if (args.length() == 0) {
// Find the JavaScript function on the top of the stack.
JavaScriptFrameIterator it(isolate);
- while (!it.done()) {
- if (it.frame()->is_java_script()) {
- function = Handle<JSFunction>(it.frame()->function());
- break;
- }
- }
+ if (!it.done()) function = Handle<JSFunction>(it.frame()->function());
if (function.is_null()) return isolate->heap()->undefined_value();
} else {
// Function was passed as an argument.
@@ -168,13 +159,6 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
function = arg;
}
- // The following condition was lifted from the DCHECK inside
- // JSFunction::MarkForOptimization().
- if (!(function->shared()->allows_lazy_compilation() ||
- !function->shared()->optimization_disabled())) {
- return isolate->heap()->undefined_value();
- }
-
// If function is interpreted but OSR hasn't been enabled, just return.
if (function->shared()->HasBytecodeArray() && !FLAG_ignition_osr) {
return isolate->heap()->undefined_value();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698