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

Unified Diff: src/hydrogen.cc

Issue 18214005: Added %NeverOptimize runtime call that can disable optimizations for a method for tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | src/runtime.h » ('j') | src/runtime.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 096c4e3356a9548c99bac1bed77a9460cbdbd110..6592a7dcaefc453409ccdbc69693d8e83a902c28 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7526,6 +7526,14 @@ void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) {
const Runtime::Function* function = expr->function();
ASSERT(function != NULL);
+
+ if (static_cast<int>(function->function_id)
+ == static_cast<int>(Runtime::kNeverOptimize)
+ && expr->arguments()->length() == 0) {
+ // %NeverOptimize() without arguments marks the caller as never optimize.
+ return Bailout("function marked itself as never optimize");
+ }
+
if (function->intrinsic_type == Runtime::INLINE) {
ASSERT(expr->name()->length() > 0);
ASSERT(expr->name()->Get(0) == '_');
« no previous file with comments | « no previous file | src/runtime.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698