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) == '_'); |