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

Unified Diff: src/hydrogen.cc

Issue 6913021: Tiny refactoring - change compilation phase parameter for CopyForInlining from a boolean to an enum. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reformat some line splitting. Created 9 years, 8 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/hydrogen.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
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 3b57f9fafa2358fe45be8fa566b147ff15e1e941..a0d783791260f3a96d9d411057548ac471b690b6 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4106,7 +4106,10 @@ bool HGraphBuilder::TryInline(Call* expr) {
HConstant* undefined = graph()->GetConstantUndefined();
HEnvironment* inner_env =
- environment()->CopyForInlining(target, function, true, undefined);
+ environment()->CopyForInlining(target,
+ function,
+ HEnvironment::HYDROGEN,
+ undefined);
HBasicBlock* body_entry = CreateBasicBlock(inner_env);
current_block()->Goto(body_entry);
@@ -5735,7 +5738,7 @@ HEnvironment* HEnvironment::CopyAsLoopHeader(HBasicBlock* loop_header) const {
HEnvironment* HEnvironment::CopyForInlining(Handle<JSFunction> target,
FunctionLiteral* function,
- bool is_speculative,
+ CompilationPhase compilation_phase,
HConstant* undefined) const {
// Outer environment is a copy of this one without the arguments.
int arity = function->scope()->num_parameters();
@@ -5746,14 +5749,16 @@ HEnvironment* HEnvironment::CopyForInlining(Handle<JSFunction> target,
HEnvironment* inner =
new(zone) HEnvironment(outer, function->scope(), target);
// Get the argument values from the original environment.
- if (is_speculative) {
+ if (compilation_phase == HYDROGEN) {
for (int i = 0; i <= arity; ++i) { // Include receiver.
HValue* push = ExpressionStackAt(arity - i);
inner->SetValueAt(i, push);
}
} else {
+ ASSERT(compilation_phase == LITHIUM);
for (int i = 0; i <= arity; ++i) { // Include receiver.
- inner->SetValueAt(i, ExpressionStackAt(arity - i));
+ HValue* push = ExpressionStackAt(arity - i);
+ inner->SetValueAt(i, push);
}
}
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698