diff options
Diffstat (limited to 'deps/v8/src/arm/lithium-arm.cc')
-rw-r--r-- | deps/v8/src/arm/lithium-arm.cc | 96 |
1 files changed, 39 insertions, 57 deletions
diff --git a/deps/v8/src/arm/lithium-arm.cc b/deps/v8/src/arm/lithium-arm.cc index fbb9c6ef8b..b08353e069 100644 --- a/deps/v8/src/arm/lithium-arm.cc +++ b/deps/v8/src/arm/lithium-arm.cc @@ -41,24 +41,6 @@ namespace internal { LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) #undef DEFINE_COMPILE -LOsrEntry::LOsrEntry() { - for (int i = 0; i < Register::NumAllocatableRegisters(); ++i) { - register_spills_[i] = NULL; - } - for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); ++i) { - double_register_spills_[i] = NULL; - } -} - - -void LOsrEntry::MarkSpilledRegister(int allocation_index, - LOperand* spill_operand) { - ASSERT(spill_operand->IsStackSlot()); - ASSERT(register_spills_[allocation_index] == NULL); - register_spills_[allocation_index] = spill_operand; -} - - #ifdef DEBUG void LInstruction::VerifyCall() { // Call instructions can use only fixed registers as temporaries and @@ -81,14 +63,6 @@ void LInstruction::VerifyCall() { #endif -void LOsrEntry::MarkSpilledDoubleRegister(int allocation_index, - LOperand* spill_operand) { - ASSERT(spill_operand->IsDoubleStackSlot()); - ASSERT(double_register_spills_[allocation_index] == NULL); - double_register_spills_[allocation_index] = spill_operand; -} - - void LInstruction::PrintTo(StringStream* stream) { stream->Add("%s ", this->Mnemonic()); @@ -352,8 +326,7 @@ void LCallNewArray::PrintDataTo(StringStream* stream) { constructor()->PrintTo(stream); stream->Add(" #%d / ", arity()); ASSERT(hydrogen()->property_cell()->value()->IsSmi()); - ElementsKind kind = static_cast<ElementsKind>( - Smi::cast(hydrogen()->property_cell()->value())->value()); + ElementsKind kind = hydrogen()->elements_kind(); stream->Add(" (%s) ", ElementsKindToString(kind)); } @@ -451,7 +424,7 @@ LOperand* LPlatformChunk::GetNextSpillSlot(bool is_double) { LPlatformChunk* LChunkBuilder::Build() { ASSERT(is_unused()); chunk_ = new(zone()) LPlatformChunk(info(), graph()); - HPhase phase("L_Building chunk", chunk_); + LPhase phase("L_Building chunk", chunk_); status_ = BUILDING; const ZoneList<HBasicBlock*>* blocks = graph()->blocks(); for (int i = 0; i < blocks->length(); i++) { @@ -929,7 +902,7 @@ LEnvironment* LChunkBuilder::CreateEnvironment( 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(), hydrogen_env->frame_type(), @@ -940,13 +913,15 @@ LEnvironment* LChunkBuilder::CreateEnvironment( outer, 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++); @@ -958,6 +933,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; } @@ -982,10 +972,13 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { LBranch* result = new(zone()) LBranch(UseRegister(value)); // Tagged values that are not known smis or booleans require a - // deoptimization environment. + // deoptimization environment. If the instruction is generic no + // environment is needed since all cases are handled. Representation rep = value->representation(); HType type = value->type(); - if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean()) { + ToBooleanStub::Types expected = instr->expected_input_types(); + if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean() && + !expected.IsGeneric()) { return AssignEnvironment(result); } return result; @@ -1386,19 +1379,6 @@ bool LChunkBuilder::HasMagicNumberForDivisor(int32_t divisor) { } -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) { if (CpuFeatures::IsSupported(SUDIV)) { // A value with an integer representation does not need to be transformed. @@ -1456,7 +1436,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { instr->CheckFlag(HValue::kBailoutOnMinusZero)) ? AssignEnvironment(result) : result; - } else if (instr->has_fixed_right_arg()) { + } else if (instr->fixed_right_arg().has_value) { LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), UseRegisterAtStart(right)); return AssignEnvironment(DefineAsRegister(mod)); @@ -1816,13 +1796,6 @@ LInstruction* LChunkBuilder::DoClassOfTestAndBranch( } -LInstruction* LChunkBuilder::DoFixedArrayBaseLength( - HFixedArrayBaseLength* instr) { - LOperand* array = UseRegisterAtStart(instr->value()); - return DefineAsRegister(new(zone()) LFixedArrayBaseLength(array)); -} - - LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { LOperand* map = UseRegisterAtStart(instr->value()); return DefineAsRegister(new(zone()) LMapEnumLength(map)); @@ -2019,7 +1992,7 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { } -LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) { +LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { LOperand* value = UseRegisterAtStart(instr->value()); return AssignEnvironment(new(zone()) LCheckNonSmi(value)); } @@ -2416,6 +2389,14 @@ LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { } +LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { + info()->MarkAsDeferredCalling(); + LAllocateObject* result = + new(zone()) LAllocateObject(TempRegister(), TempRegister()); + return AssignPointerMap(DefineAsRegister(result)); +} + + LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { info()->MarkAsDeferredCalling(); LOperand* size = instr->size()->IsConstant() @@ -2588,8 +2569,9 @@ 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); |