| Index: src/arm/lithium-codegen-arm.cc
|
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
|
| index 5aebadaef36b96eb101224281b940ee4b6ac872f..8f1c9c090dfbdf6e1de38ed34c1f028a2efbe8b0 100644
|
| --- a/src/arm/lithium-codegen-arm.cc
|
| +++ b/src/arm/lithium-codegen-arm.cc
|
| @@ -84,9 +84,7 @@ void LCodeGen::FinishCode(Handle<Code> code) {
|
| ASSERT(is_done());
|
| code->set_stack_slots(GetStackSlotCount());
|
| code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
|
| - if (FLAG_weak_embedded_maps_in_optimized_code) {
|
| - RegisterDependentCodeForEmbeddedMaps(code);
|
| - }
|
| + RegisterDependentCodeForEmbeddedMaps(code);
|
| PopulateDeoptimizationData(code);
|
| info()->CommitDependencies(code);
|
| }
|
| @@ -887,36 +885,6 @@ void LCodeGen::DeoptimizeIf(Condition condition,
|
| }
|
|
|
|
|
| -void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) {
|
| - ZoneList<Handle<Map> > maps(1, zone());
|
| - ZoneList<Handle<JSObject> > objects(1, zone());
|
| - int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
|
| - for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
|
| - if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) {
|
| - if (it.rinfo()->target_object()->IsMap()) {
|
| - Handle<Map> map(Map::cast(it.rinfo()->target_object()));
|
| - maps.Add(map, zone());
|
| - } else if (it.rinfo()->target_object()->IsJSObject()) {
|
| - Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object()));
|
| - objects.Add(object, zone());
|
| - }
|
| - }
|
| - }
|
| -#ifdef VERIFY_HEAP
|
| - // This disables verification of weak embedded objects after full GC.
|
| - // AddDependentCode can cause a GC, which would observe the state where
|
| - // this code is not yet in the depended code lists of the embedded maps.
|
| - NoWeakObjectVerificationScope disable_verification_of_embedded_objects;
|
| -#endif
|
| - for (int i = 0; i < maps.length(); i++) {
|
| - maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code);
|
| - }
|
| - for (int i = 0; i < objects.length(); i++) {
|
| - AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code);
|
| - }
|
| -}
|
| -
|
| -
|
| void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
|
| int length = deoptimizations_.length();
|
| if (length == 0) return;
|
| @@ -2047,8 +2015,7 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
|
|
|
|
| void LCodeGen::DoThrow(LThrow* instr) {
|
| - Register input_reg = EmitLoadRegister(instr->value(), ip);
|
| - __ push(input_reg);
|
| + __ push(ToRegister(instr->value()));
|
| ASSERT(ToRegister(instr->context()).is(cp));
|
| CallRuntime(Runtime::kThrow, 1, instr);
|
|
|
| @@ -2186,7 +2153,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
|
| ASSERT(ToRegister(instr->right()).is(r0));
|
| ASSERT(ToRegister(instr->result()).is(r0));
|
|
|
| - BinaryOpStub stub(instr->op(), NO_OVERWRITE);
|
| + BinaryOpICStub stub(instr->op(), NO_OVERWRITE);
|
| // Block literal pool emission to ensure nop indicating no inlined smi code
|
| // is in the correct position.
|
| Assembler::BlockConstPoolScope block_const_pool(masm());
|
| @@ -3496,12 +3463,13 @@ void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
|
| void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| Register receiver = ToRegister(instr->receiver());
|
| Register function = ToRegister(instr->function());
|
| + Register result = ToRegister(instr->result());
|
| Register scratch = scratch0();
|
|
|
| // If the receiver is null or undefined, we have to pass the global
|
| // object as a receiver to normal functions. Values have to be
|
| // passed unchanged to builtins and strict-mode functions.
|
| - Label global_object, receiver_ok;
|
| + Label global_object, result_in_receiver;
|
|
|
| // Do not transform the receiver to object for strict mode
|
| // functions.
|
| @@ -3511,11 +3479,11 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| FieldMemOperand(scratch, SharedFunctionInfo::kCompilerHintsOffset));
|
| __ tst(scratch,
|
| Operand(1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize)));
|
| - __ b(ne, &receiver_ok);
|
| + __ b(ne, &result_in_receiver);
|
|
|
| // Do not transform the receiver to object for builtins.
|
| __ tst(scratch, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize)));
|
| - __ b(ne, &receiver_ok);
|
| + __ b(ne, &result_in_receiver);
|
|
|
| // Normal function. Replace undefined or null with global receiver.
|
| __ LoadRoot(scratch, Heap::kNullValueRootIndex);
|
| @@ -3530,13 +3498,21 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| DeoptimizeIf(eq, instr->environment());
|
| __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE);
|
| DeoptimizeIf(lt, instr->environment());
|
| - __ jmp(&receiver_ok);
|
| + __ b(&result_in_receiver);
|
|
|
| __ bind(&global_object);
|
| - __ ldr(receiver, GlobalObjectOperand());
|
| - __ ldr(receiver,
|
| - FieldMemOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
|
| - __ bind(&receiver_ok);
|
| + __ ldr(result, GlobalObjectOperand());
|
| + __ ldr(result,
|
| + FieldMemOperand(result, JSGlobalObject::kGlobalReceiverOffset));
|
| + if (result.is(receiver)) {
|
| + __ bind(&result_in_receiver);
|
| + } else {
|
| + Label result_ok;
|
| + __ b(&result_ok);
|
| + __ bind(&result_in_receiver);
|
| + __ mov(result, receiver);
|
| + __ bind(&result_ok);
|
| + }
|
| }
|
|
|
|
|
| @@ -3975,39 +3951,6 @@ void LCodeGen::DoMathLog(LMathLog* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoMathTan(LMathTan* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(d2));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ mov(cp, Operand::Zero());
|
| - TranscendentalCacheStub stub(TranscendentalCache::TAN,
|
| - TranscendentalCacheStub::UNTAGGED);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| -}
|
| -
|
| -
|
| -void LCodeGen::DoMathCos(LMathCos* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(d2));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ mov(cp, Operand::Zero());
|
| - TranscendentalCacheStub stub(TranscendentalCache::COS,
|
| - TranscendentalCacheStub::UNTAGGED);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| -}
|
| -
|
| -
|
| -void LCodeGen::DoMathSin(LMathSin* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(d2));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ mov(cp, Operand::Zero());
|
| - TranscendentalCacheStub stub(TranscendentalCache::SIN,
|
| - TranscendentalCacheStub::UNTAGGED);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
|
| ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->function()).is(r1));
|
| @@ -4170,7 +4113,13 @@ void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) {
|
| void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
|
| Register result = ToRegister(instr->result());
|
| Register base = ToRegister(instr->base_object());
|
| - __ add(result, base, Operand(instr->offset()));
|
| + if (instr->offset()->IsConstantOperand()) {
|
| + LConstantOperand* offset = LConstantOperand::cast(instr->offset());
|
| + __ add(result, base, Operand(ToInteger32(offset)));
|
| + } else {
|
| + Register offset = ToRegister(instr->offset());
|
| + __ add(result, base, offset);
|
| + }
|
| }
|
|
|
|
|
| @@ -4762,14 +4711,13 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) {
|
| LNumberTagU* instr_;
|
| };
|
|
|
| - LOperand* input = instr->value();
|
| - ASSERT(input->IsRegister() && input->Equals(instr->result()));
|
| - Register reg = ToRegister(input);
|
| + Register input = ToRegister(instr->value());
|
| + Register result = ToRegister(instr->result());
|
|
|
| DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr);
|
| - __ cmp(reg, Operand(Smi::kMaxValue));
|
| + __ cmp(input, Operand(Smi::kMaxValue));
|
| __ b(hi, deferred->entry());
|
| - __ SmiTag(reg, reg);
|
| + __ SmiTag(result, input);
|
| __ bind(deferred->exit());
|
| }
|
|
|
|
|