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);
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();
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);
}
}
class HEnvironment: public ZoneObject {
public:
+ enum CompilationPhase { HYDROGEN, LITHIUM };
+
HEnvironment(HEnvironment* outer,
Scope* scope,
Handle<JSFunction> closure);
// instructions, otherwise they are the actual values.
HEnvironment* CopyForInlining(Handle<JSFunction> target,
FunctionLiteral* function,
- bool is_speculative,
+ CompilationPhase compilation_phase,
HConstant* undefined) const;
void AddIncomingEdge(HBasicBlock* block, HEnvironment* other);