Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(909)

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 21173004: Version 3.20.11.1 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index e9210a9eed693843f20246ac7fd9c6ca9424b516..364c3a1824ef671ee44dcd8f984d4be0363da993 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -429,13 +429,6 @@ double LCodeGen::ToDouble(LConstantOperand* op) const {
}
-ExternalReference LCodeGen::ToExternalReference(LConstantOperand* op) const {
- HConstant* constant = chunk_->LookupConstant(op);
- ASSERT(constant->HasExternalReferenceValue());
- return constant->ExternalReferenceValue();
-}
-
-
Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const {
HConstant* constant = chunk_->LookupConstant(op);
ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged());
@@ -1460,11 +1453,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
break;
case Token::SHL:
if (shift_count != 0) {
- if (instr->hydrogen_value()->representation().IsSmi()) {
- __ shl(ToRegister(left), Immediate(shift_count));
- } else {
- __ shll(ToRegister(left), Immediate(shift_count));
- }
+ __ shll(ToRegister(left), Immediate(shift_count));
}
break;
default:
@@ -1530,11 +1519,6 @@ void LCodeGen::DoConstantD(LConstantD* instr) {
}
-void LCodeGen::DoConstantE(LConstantE* instr) {
- __ LoadAddress(ToRegister(instr->result()), instr->value());
-}
-
-
void LCodeGen::DoConstantT(LConstantT* instr) {
Handle<Object> value = instr->value();
AllowDeferredHandleDereference smi_check;
@@ -1715,7 +1699,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
LOperand* right = instr->right();
ASSERT(left->Equals(instr->result()));
HMathMinMax::Operation operation = instr->hydrogen()->operation();
- if (instr->hydrogen()->representation().IsSmiOrInteger32()) {
+ if (instr->hydrogen()->representation().IsInteger32()) {
Label return_left;
Condition condition = (operation == HMathMinMax::kMathMin)
? less_equal
@@ -1724,26 +1708,17 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
if (right->IsConstantOperand()) {
Immediate right_imm =
Immediate(ToInteger32(LConstantOperand::cast(right)));
- ASSERT(!instr->hydrogen_value()->representation().IsSmi());
__ cmpl(left_reg, right_imm);
__ j(condition, &return_left, Label::kNear);
__ movq(left_reg, right_imm);
} else if (right->IsRegister()) {
Register right_reg = ToRegister(right);
- if (instr->hydrogen_value()->representation().IsSmi()) {
- __ cmpq(left_reg, right_reg);
- } else {
- __ cmpl(left_reg, right_reg);
- }
+ __ cmpl(left_reg, right_reg);
__ j(condition, &return_left, Label::kNear);
__ movq(left_reg, right_reg);
} else {
Operand right_op = ToOperand(right);
- if (instr->hydrogen_value()->representation().IsSmi()) {
- __ cmpq(left_reg, right_op);
- } else {
- __ cmpl(left_reg, right_op);
- }
+ __ cmpl(left_reg, right_op);
__ j(condition, &return_left, Label::kNear);
__ movq(left_reg, right_op);
}
@@ -2701,19 +2676,6 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
HObjectAccess access = instr->hydrogen()->access();
int offset = access.offset();
-
- if (access.IsExternalMemory()) {
- Register result = ToRegister(instr->result());
- if (instr->object()->IsConstantOperand()) {
- ASSERT(result.is(rax));
- __ load_rax(ToExternalReference(LConstantOperand::cast(instr->object())));
- } else {
- Register object = ToRegister(instr->object());
- __ movq(result, MemOperand(object, offset));
- }
- return;
- }
-
Register object = ToRegister(instr->object());
if (FLAG_track_double_fields &&
instr->hydrogen()->representation().IsDouble()) {
@@ -3951,23 +3913,11 @@ void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
Representation representation = instr->representation();
+ Register object = ToRegister(instr->object());
+
HObjectAccess access = instr->hydrogen()->access();
int offset = access.offset();
- if (access.IsExternalMemory()) {
- Register value = ToRegister(instr->value());
- if (instr->object()->IsConstantOperand()) {
- ASSERT(value.is(rax));
- LConstantOperand* object = LConstantOperand::cast(instr->object());
- __ store_rax(ToExternalReference(object));
- } else {
- Register object = ToRegister(instr->object());
- __ movq(MemOperand(object, offset), value);
- }
- return;
- }
-
- Register object = ToRegister(instr->object());
Handle<Map> transition = instr->transition();
if (FLAG_track_fields && representation.IsSmi()) {
@@ -4325,7 +4275,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
ASSERT_NE(instr->temp(), NULL);
__ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg,
ToRegister(instr->temp()), kDontSaveFPRegs);
- } else {
+ } else if (FLAG_compiled_transitions) {
PushSafepointRegistersScope scope(this);
if (!object_reg.is(rax)) {
__ movq(rax, object_reg);
@@ -4335,6 +4285,28 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
__ CallStub(&stub);
RecordSafepointWithRegisters(
instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
+ } else if (IsFastSmiElementsKind(from_kind) &&
+ IsFastDoubleElementsKind(to_kind)) {
+ Register fixed_object_reg = ToRegister(instr->temp());
+ ASSERT(fixed_object_reg.is(rdx));
+ Register new_map_reg = ToRegister(instr->new_map_temp());
+ ASSERT(new_map_reg.is(rbx));
+ __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT);
+ __ movq(fixed_object_reg, object_reg);
+ CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(),
+ RelocInfo::CODE_TARGET, instr);
+ } else if (IsFastDoubleElementsKind(from_kind) &&
+ IsFastObjectElementsKind(to_kind)) {
+ Register fixed_object_reg = ToRegister(instr->temp());
+ ASSERT(fixed_object_reg.is(rdx));
+ Register new_map_reg = ToRegister(instr->new_map_temp());
+ ASSERT(new_map_reg.is(rbx));
+ __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT);
+ __ movq(fixed_object_reg, object_reg);
+ CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(),
+ RelocInfo::CODE_TARGET, instr);
+ } else {
+ UNREACHABLE();
}
__ bind(&not_applicable);
}
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698