| Index: src/a64/lithium-a64.cc
|
| diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc
|
| index 1620222c9c28aa7fd04bd4fbf4c96ac7a8e67fa3..c0b6309289752d0c2ab38acadbc846fa0c3ea530 100644
|
| --- a/src/a64/lithium-a64.cc
|
| +++ b/src/a64/lithium-a64.cc
|
| @@ -698,7 +698,7 @@ LEnvironment* LChunkBuilder::CreateEnvironment(
|
| CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator);
|
| BailoutId ast_id = hydrogen_env->ast_id();
|
| ASSERT(!ast_id.IsNone() || (hydrogen_env->frame_type() != JS_FUNCTION));
|
| - int value_count = hydrogen_env->length();
|
| + int value_count = hydrogen_env->length() - hydrogen_env->specials_count();
|
|
|
| LEnvironment* result = new(zone()) LEnvironment(
|
| hydrogen_env->closure(),
|
| @@ -711,13 +711,15 @@ LEnvironment* LChunkBuilder::CreateEnvironment(
|
| hydrogen_env->entry(),
|
| zone());
|
|
|
| + bool needs_arguments_object_materialization = false;
|
| int argument_index = *argument_index_accumulator;
|
| - for (int i = 0; i < value_count; ++i) {
|
| + for (int i = 0; i < hydrogen_env->length(); ++i) {
|
| if (hydrogen_env->is_special_index(i)) continue;
|
|
|
| HValue* value = hydrogen_env->values()->at(i);
|
| LOperand* op = NULL;
|
| if (value->IsArgumentsObject()) {
|
| + needs_arguments_object_materialization = true;
|
| op = NULL;
|
| } else if (value->IsPushArgument()) {
|
| op = new(zone()) LArgument(argument_index++);
|
| @@ -729,6 +731,21 @@ LEnvironment* LChunkBuilder::CreateEnvironment(
|
| value->CheckFlag(HInstruction::kUint32));
|
| }
|
|
|
| + if (needs_arguments_object_materialization) {
|
| + HArgumentsObject* arguments = hydrogen_env->entry() == NULL
|
| + ? graph()->GetArgumentsObject()
|
| + : hydrogen_env->entry()->arguments_object();
|
| + ASSERT(arguments->IsLinked());
|
| + for (int i = 1; i < arguments->arguments_count(); ++i) {
|
| + HValue* value = arguments->arguments_values()->at(i);
|
| + ASSERT(!value->IsArgumentsObject() && !value->IsPushArgument());
|
| + LOperand* op = UseAny(value);
|
| + result->AddValue(op,
|
| + value->representation(),
|
| + value->CheckFlag(HInstruction::kUint32));
|
| + }
|
| + }
|
| +
|
| if (hydrogen_env->frame_type() == JS_FUNCTION) {
|
| *argument_index_accumulator = argument_index;
|
| }
|
| @@ -1381,8 +1398,10 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
|
| undefined,
|
| instr->inlining_kind(),
|
| instr->undefined_receiver());
|
| - if (instr->arguments_var() != NULL) {
|
| - inner->Bind(instr->arguments_var(), graph()->GetArgumentsObject());
|
| + // Only replay binding of arguments object if it wasn't removed from graph.
|
| + if ((instr->arguments_var() != NULL) &&
|
| + instr->arguments_object()->IsLinked()) {
|
| + inner->Bind(instr->arguments_var(), instr->arguments_object());
|
| }
|
| inner->set_entry(instr);
|
| current_block_->UpdateEnvironment(inner);
|
| @@ -1692,19 +1711,6 @@ LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) {
|
| }
|
|
|
|
|
| -HValue* LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(HValue* dividend) {
|
| - // A value with an integer representation does not need to be transformed.
|
| - if (dividend->representation().IsInteger32()) {
|
| - return dividend;
|
| - // A change from an integer32 can be replaced by the integer32 value.
|
| - } else if (dividend->IsChange() &&
|
| - HChange::cast(dividend)->from().IsInteger32()) {
|
| - return HChange::cast(dividend)->value();
|
| - }
|
| - return NULL;
|
| -}
|
| -
|
| -
|
| HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) {
|
| // A value with an integer representation does not need to be transformed.
|
| if (divisor->representation().IsInteger32()) {
|
|
|