Cleanup to HEnvironment::CopyForInlining

* src/hydrogen.cc (HEnvironment::CopyForInlining): As the code for both
  the ::HYDROGEN and ::LITHIUM compilation phases is the same, just use
  one code path and remove the arg.

* src/hydrogen.h (HEnvironment): Remove now-unused CompilationPhase
  enum type and arg to CopyForInlining.

* src/arm/lithium-arm.cc (LChunkBuilder::DoEnterInlined):
* src/ia32/lithium-ia32.cc (LChunkBuilder::DoEnterInlined):
* src/x64/lithium-x64.cc (LChunkBuilder::DoEnterInlined): Adapt
  callers.

* AUTHORS: Add Igalia.

BUG=
TEST=I ran tools/test.py.

Review URL: http://codereview.chromium.org/7272002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8442 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2011-06-28 08:54:09 +00:00
parent b59f2b700b
commit 3f6043d370
6 changed files with 5 additions and 22 deletions

View File

@ -7,6 +7,7 @@ Google Inc.
Sigma Designs Inc.
ARM Ltd.
Hewlett-Packard Development Company, LP
Igalia, S.L.
Akinori MUSHA <knu@FreeBSD.org>
Alexander Botero-Lowry <alexbl@FreeBSD.org>

View File

@ -2217,7 +2217,6 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
HConstant* undefined = graph()->GetConstantUndefined();
HEnvironment* inner = outer->CopyForInlining(instr->closure(),
instr->function(),
HEnvironment::LITHIUM,
undefined,
instr->call_kind());
current_block_->UpdateEnvironment(inner);

View File

@ -4449,7 +4449,6 @@ bool HGraphBuilder::TryInline(Call* expr) {
HEnvironment* inner_env =
environment()->CopyForInlining(target,
function,
HEnvironment::HYDROGEN,
undefined,
call_kind);
HBasicBlock* body_entry = CreateBasicBlock(inner_env);
@ -6212,7 +6211,6 @@ HEnvironment* HEnvironment::CopyAsLoopHeader(HBasicBlock* loop_header) const {
HEnvironment* HEnvironment::CopyForInlining(
Handle<JSFunction> target,
FunctionLiteral* function,
CompilationPhase compilation_phase,
HConstant* undefined,
CallKind call_kind) const {
// Outer environment is a copy of this one without the arguments.
@ -6224,17 +6222,9 @@ HEnvironment* HEnvironment::CopyForInlining(
HEnvironment* inner =
new(zone) HEnvironment(outer, function->scope(), target);
// Get the argument values from the original environment.
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.
HValue* push = ExpressionStackAt(arity - i);
inner->SetValueAt(i, push);
}
for (int i = 0; i <= arity; ++i) { // Include receiver.
HValue* push = ExpressionStackAt(arity - i);
inner->SetValueAt(i, push);
}
// If the function we are inlining is a strict mode function or a
// builtin function, pass undefined as the receiver for function

View File

@ -329,8 +329,6 @@ Zone* HBasicBlock::zone() { return graph_->zone(); }
class HEnvironment: public ZoneObject {
public:
enum CompilationPhase { HYDROGEN, LITHIUM };
HEnvironment(HEnvironment* outer,
Scope* scope,
Handle<JSFunction> closure);
@ -417,12 +415,9 @@ class HEnvironment: public ZoneObject {
// Create an "inlined version" of this environment, where the original
// environment is the outer environment but the top expression stack
// elements are moved to an inner environment as parameters. If
// is_speculative, the argument values are expected to be PushArgument
// instructions, otherwise they are the actual values.
// elements are moved to an inner environment as parameters.
HEnvironment* CopyForInlining(Handle<JSFunction> target,
FunctionLiteral* function,
CompilationPhase compilation_phase,
HConstant* undefined,
CallKind call_kind) const;

View File

@ -2267,7 +2267,6 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
HConstant* undefined = graph()->GetConstantUndefined();
HEnvironment* inner = outer->CopyForInlining(instr->closure(),
instr->function(),
HEnvironment::LITHIUM,
undefined,
instr->call_kind());
current_block_->UpdateEnvironment(inner);

View File

@ -2208,7 +2208,6 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
HConstant* undefined = graph()->GetConstantUndefined();
HEnvironment* inner = outer->CopyForInlining(instr->closure(),
instr->function(),
HEnvironment::LITHIUM,
undefined,
instr->call_kind());
current_block_->UpdateEnvironment(inner);