| Index: src/x64/lithium-codegen-x64.cc
|
| diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
|
| index cf0632e044955d245e9712f26552115280ae2c9c..c6d5a147a76ac8e484273753421cb459158d7500 100644
|
| --- a/src/x64/lithium-codegen-x64.cc
|
| +++ b/src/x64/lithium-codegen-x64.cc
|
| @@ -777,36 +777,6 @@ void LCodeGen::DeoptimizeIf(Condition cc,
|
| }
|
|
|
|
|
| -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;
|
| @@ -1781,14 +1751,22 @@ void LCodeGen::DoAddI(LAddI* instr) {
|
| LOperand* left = instr->left();
|
| LOperand* right = instr->right();
|
|
|
| + Representation target_rep = instr->hydrogen()->representation();
|
| + bool is_q = target_rep.IsSmi() || target_rep.IsExternal();
|
| +
|
| if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) {
|
| if (right->IsConstantOperand()) {
|
| int32_t offset = ToInteger32(LConstantOperand::cast(right));
|
| - __ leal(ToRegister(instr->result()),
|
| - MemOperand(ToRegister(left), offset));
|
| + if (is_q) {
|
| + __ lea(ToRegister(instr->result()),
|
| + MemOperand(ToRegister(left), offset));
|
| + } else {
|
| + __ leal(ToRegister(instr->result()),
|
| + MemOperand(ToRegister(left), offset));
|
| + }
|
| } else {
|
| Operand address(ToRegister(left), ToRegister(right), times_1, 0);
|
| - if (instr->hydrogen()->representation().IsSmi()) {
|
| + if (is_q) {
|
| __ lea(ToRegister(instr->result()), address);
|
| } else {
|
| __ leal(ToRegister(instr->result()), address);
|
| @@ -1796,16 +1774,21 @@ void LCodeGen::DoAddI(LAddI* instr) {
|
| }
|
| } else {
|
| if (right->IsConstantOperand()) {
|
| - __ addl(ToRegister(left),
|
| - Immediate(ToInteger32(LConstantOperand::cast(right))));
|
| + if (is_q) {
|
| + __ addq(ToRegister(left),
|
| + Immediate(ToInteger32(LConstantOperand::cast(right))));
|
| + } else {
|
| + __ addl(ToRegister(left),
|
| + Immediate(ToInteger32(LConstantOperand::cast(right))));
|
| + }
|
| } else if (right->IsRegister()) {
|
| - if (instr->hydrogen_value()->representation().IsSmi()) {
|
| + if (is_q) {
|
| __ addq(ToRegister(left), ToRegister(right));
|
| } else {
|
| __ addl(ToRegister(left), ToRegister(right));
|
| }
|
| } else {
|
| - if (instr->hydrogen_value()->representation().IsSmi()) {
|
| + if (is_q) {
|
| __ addq(ToRegister(left), ToOperand(right));
|
| } else {
|
| __ addl(ToRegister(left), ToOperand(right));
|
| @@ -1938,7 +1921,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
|
| ASSERT(ToRegister(instr->right()).is(rax));
|
| ASSERT(ToRegister(instr->result()).is(rax));
|
|
|
| - BinaryOpStub stub(instr->op(), NO_OVERWRITE);
|
| + BinaryOpICStub stub(instr->op(), NO_OVERWRITE);
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| __ nop(); // Signals no inlined code.
|
| }
|
| @@ -2860,7 +2843,17 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
|
| __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset));
|
| object = result;
|
| }
|
| - __ Load(result, FieldOperand(object, offset), access.representation());
|
| +
|
| + Representation representation = access.representation();
|
| + if (representation.IsSmi() &&
|
| + instr->hydrogen()->representation().IsInteger32()) {
|
| + // Read int value directly from upper half of the smi.
|
| + STATIC_ASSERT(kSmiTag == 0);
|
| + STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
|
| + offset += kPointerSize / 2;
|
| + representation = Representation::Integer32();
|
| + }
|
| + __ Load(result, FieldOperand(object, offset), representation);
|
| }
|
|
|
|
|
| @@ -3764,39 +3757,6 @@ void LCodeGen::DoMathLog(LMathLog* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoMathTan(LMathTan* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ Set(rsi, 0);
|
| - TranscendentalCacheStub stub(TranscendentalCache::TAN,
|
| - TranscendentalCacheStub::UNTAGGED);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| -}
|
| -
|
| -
|
| -void LCodeGen::DoMathCos(LMathCos* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ Set(rsi, 0);
|
| - TranscendentalCacheStub stub(TranscendentalCache::COS,
|
| - TranscendentalCacheStub::UNTAGGED);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| -}
|
| -
|
| -
|
| -void LCodeGen::DoMathSin(LMathSin* instr) {
|
| - ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
|
| - // Set the context register to a GC-safe fake value. Clobbering it is
|
| - // OK because this instruction is marked as a call.
|
| - __ Set(rsi, 0);
|
| - TranscendentalCacheStub stub(TranscendentalCache::SIN,
|
| - TranscendentalCacheStub::UNTAGGED);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
|
| ASSERT(ToRegister(instr->context()).is(rsi));
|
| ASSERT(ToRegister(instr->function()).is(rdi));
|
| @@ -3959,7 +3919,13 @@ void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) {
|
| void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
|
| Register result = ToRegister(instr->result());
|
| Register base = ToRegister(instr->base_object());
|
| - __ lea(result, Operand(base, instr->offset()));
|
| + if (instr->offset()->IsConstantOperand()) {
|
| + LConstantOperand* offset = LConstantOperand::cast(instr->offset());
|
| + __ lea(result, Operand(base, ToInteger32(offset)));
|
| + } else {
|
| + Register offset = ToRegister(instr->offset());
|
| + __ lea(result, Operand(base, offset, times_1, 0));
|
| + }
|
| }
|
|
|
|
|
| @@ -4350,11 +4316,11 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
|
| __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg,
|
| ToRegister(instr->temp()), kDontSaveFPRegs);
|
| } else {
|
| + ASSERT(ToRegister(instr->context()).is(rsi));
|
| PushSafepointRegistersScope scope(this);
|
| if (!object_reg.is(rax)) {
|
| __ movq(rax, object_reg);
|
| }
|
| - LoadContextFromDeferred(instr->context());
|
| __ Move(rbx, to_map);
|
| TransitionElementsKindStub stub(from_kind, to_kind);
|
| __ CallStub(&stub);
|
|
|