| Index: src/mips/lithium-codegen-mips.cc
|
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
|
| index 71bacbae651a31e03bd9e376ca54665b2f13319a..b4d9441b58d4b205f983e1d3f032d589a1e51f84 100644
|
| --- a/src/mips/lithium-codegen-mips.cc
|
| +++ b/src/mips/lithium-codegen-mips.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);
|
| }
|
| @@ -847,36 +845,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;
|
| @@ -1841,8 +1809,7 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
|
|
|
|
| void LCodeGen::DoThrow(LThrow* instr) {
|
| - Register input_reg = EmitLoadRegister(instr->value(), at);
|
| - __ push(input_reg);
|
| + __ push(ToRegister(instr->value()));
|
| ASSERT(ToRegister(instr->context()).is(cp));
|
| CallRuntime(Runtime::kThrow, 1, instr);
|
|
|
| @@ -2000,7 +1967,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
|
| ASSERT(ToRegister(instr->right()).is(a0));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| - BinaryOpStub stub(instr->op(), NO_OVERWRITE);
|
| + BinaryOpICStub stub(instr->op(), NO_OVERWRITE);
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| // Other arch use a nop here, to signal that there is no inlined
|
| // patchable code. Mips does not need the nop, since our marker
|
| @@ -3373,12 +3340,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.
|
| @@ -3392,7 +3360,7 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| 1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize);
|
| int32_t native_mask = 1 << (SharedFunctionInfo::kNative + kSmiTagSize);
|
| __ And(scratch, scratch, Operand(strict_mode_function_mask | native_mask));
|
| - __ Branch(&receiver_ok, ne, scratch, Operand(zero_reg));
|
| + __ Branch(&result_in_receiver, ne, scratch, Operand(zero_reg));
|
|
|
| // Normal function. Replace undefined or null with global receiver.
|
| __ LoadRoot(scratch, Heap::kNullValueRootIndex);
|
| @@ -3407,13 +3375,21 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| __ GetObjectType(receiver, scratch, scratch);
|
| DeoptimizeIf(lt, instr->environment(),
|
| scratch, Operand(FIRST_SPEC_OBJECT_TYPE));
|
| - __ Branch(&receiver_ok);
|
| + __ Branch(&result_in_receiver);
|
|
|
| __ bind(&global_object);
|
| - __ lw(receiver, GlobalObjectOperand());
|
| - __ lw(receiver,
|
| - FieldMemOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
|
| - __ bind(&receiver_ok);
|
| + __ lw(result, GlobalObjectOperand());
|
| + __ lw(result,
|
| + FieldMemOperand(result, JSGlobalObject::kGlobalReceiverOffset));
|
| + if (result.is(receiver)) {
|
| + __ bind(&result_in_receiver);
|
| + } else {
|
| + Label result_ok;
|
| + __ Branch(&result_ok);
|
| + __ bind(&result_in_receiver);
|
| + __ mov(result, receiver);
|
| + __ bind(&result_ok);
|
| + }
|
| }
|
|
|
|
|
| @@ -3898,39 +3874,6 @@ void LCodeGen::DoMathLog(LMathLog* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoMathTan(LMathTan* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(f4));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ mov(cp, zero_reg);
|
| - TranscendentalCacheStub stub(TranscendentalCache::TAN,
|
| - TranscendentalCacheStub::UNTAGGED);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| -}
|
| -
|
| -
|
| -void LCodeGen::DoMathCos(LMathCos* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(f4));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ mov(cp, zero_reg);
|
| - TranscendentalCacheStub stub(TranscendentalCache::COS,
|
| - TranscendentalCacheStub::UNTAGGED);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| -}
|
| -
|
| -
|
| -void LCodeGen::DoMathSin(LMathSin* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(f4));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ mov(cp, zero_reg);
|
| - 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(a1));
|
| @@ -4093,7 +4036,13 @@ void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) {
|
| void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
|
| Register result = ToRegister(instr->result());
|
| Register base = ToRegister(instr->base_object());
|
| - __ Addu(result, base, Operand(instr->offset()));
|
| + if (instr->offset()->IsConstantOperand()) {
|
| + LConstantOperand* offset = LConstantOperand::cast(instr->offset());
|
| + __ Addu(result, base, Operand(ToInteger32(offset)));
|
| + } else {
|
| + Register offset = ToRegister(instr->offset());
|
| + __ Addu(result, base, offset);
|
| + }
|
| }
|
|
|
|
|
| @@ -4708,13 +4657,12 @@ 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);
|
| - __ Branch(deferred->entry(), hi, reg, Operand(Smi::kMaxValue));
|
| - __ SmiTag(reg, reg);
|
| + __ Branch(deferred->entry(), hi, input, Operand(Smi::kMaxValue));
|
| + __ SmiTag(result, input);
|
| __ bind(deferred->exit());
|
| }
|
|
|
|
|