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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/runtime.h » ('j') | src/runtime.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 7508 matching lines...) Expand 10 before | Expand all | Expand 10 after
7519 void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) { 7519 void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) {
7520 ASSERT(!HasStackOverflow()); 7520 ASSERT(!HasStackOverflow());
7521 ASSERT(current_block() != NULL); 7521 ASSERT(current_block() != NULL);
7522 ASSERT(current_block()->HasPredecessor()); 7522 ASSERT(current_block()->HasPredecessor());
7523 if (expr->is_jsruntime()) { 7523 if (expr->is_jsruntime()) {
7524 return Bailout("call to a JavaScript runtime function"); 7524 return Bailout("call to a JavaScript runtime function");
7525 } 7525 }
7526 7526
7527 const Runtime::Function* function = expr->function(); 7527 const Runtime::Function* function = expr->function();
7528 ASSERT(function != NULL); 7528 ASSERT(function != NULL);
7529
7530 if (static_cast<int>(function->function_id)
7531 == static_cast<int>(Runtime::kNeverOptimize)
7532 && expr->arguments()->length() == 0) {
7533 // %NeverOptimize() without arguments marks the caller as never optimize.
7534 return Bailout("function marked itself as never optimize");
7535 }
7536
7529 if (function->intrinsic_type == Runtime::INLINE) { 7537 if (function->intrinsic_type == Runtime::INLINE) {
7530 ASSERT(expr->name()->length() > 0); 7538 ASSERT(expr->name()->length() > 0);
7531 ASSERT(expr->name()->Get(0) == '_'); 7539 ASSERT(expr->name()->Get(0) == '_');
7532 // Call to an inline function. 7540 // Call to an inline function.
7533 int lookup_index = static_cast<int>(function->function_id) - 7541 int lookup_index = static_cast<int>(function->function_id) -
7534 static_cast<int>(Runtime::kFirstInlineFunction); 7542 static_cast<int>(Runtime::kFirstInlineFunction);
7535 ASSERT(lookup_index >= 0); 7543 ASSERT(lookup_index >= 0);
7536 ASSERT(static_cast<size_t>(lookup_index) < 7544 ASSERT(static_cast<size_t>(lookup_index) <
7537 ARRAY_SIZE(kInlineFunctionGenerators)); 7545 ARRAY_SIZE(kInlineFunctionGenerators));
7538 InlineFunctionGenerator generator = kInlineFunctionGenerators[lookup_index]; 7546 InlineFunctionGenerator generator = kInlineFunctionGenerators[lookup_index];
(...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after
10114 if (ShouldProduceTraceOutput()) { 10122 if (ShouldProduceTraceOutput()) {
10115 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 10123 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
10116 } 10124 }
10117 10125
10118 #ifdef DEBUG 10126 #ifdef DEBUG
10119 graph_->Verify(false); // No full verify. 10127 graph_->Verify(false); // No full verify.
10120 #endif 10128 #endif
10121 } 10129 }
10122 10130
10123 } } // namespace v8::internal 10131 } } // namespace v8::internal
OLDNEW
« 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