Revision: 17099
Author: [email protected]
Date: Fri Oct 4 05:47:35 2013 UTC
Log: Revert "Add support to load/store byte fields." and "MIPS: Add
support to load/store byte fields.".
This reverts commit r17079 and r17085. Will reland after fix.
[email protected]
Review URL: https://codereview.chromium.org/25679008
http://code.google.com/p/v8/source/detail?r=17099
Modified:
/branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/property-details.h
/branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
/branches/bleeding_edge/src/x64/lithium-x64.cc
/branches/bleeding_edge/src/x64/macro-assembler-x64.cc
/branches/bleeding_edge/src/x64/macro-assembler-x64.h
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Wed Oct 2
13:27:53 2013 UTC
+++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Fri Oct 4
05:47:35 2013 UTC
@@ -3042,12 +3042,7 @@
if (access.IsExternalMemory()) {
Register result = ToRegister(instr->result());
- MemOperand operand = MemOperand(object, offset);
- if (access.representation().IsByte()) {
- __ ldrb(result, operand);
- } else {
- __ ldr(result, operand);
- }
+ __ ldr(result, MemOperand(object, offset));
return;
}
@@ -3058,15 +3053,11 @@
}
Register result = ToRegister(instr->result());
- if (!access.IsInobject()) {
- __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
- object = result;
- }
- MemOperand operand = FieldMemOperand(object, offset);
- if (access.representation().IsByte()) {
- __ ldrb(result, operand);
+ if (access.IsInobject()) {
+ __ ldr(result, FieldMemOperand(object, offset));
} else {
- __ ldr(result, operand);
+ __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
+ __ ldr(result, FieldMemOperand(result, offset));
}
}
@@ -4172,12 +4163,7 @@
if (access.IsExternalMemory()) {
Register value = ToRegister(instr->value());
- MemOperand operand = MemOperand(object, offset);
- if (representation.IsByte()) {
- __ strb(value, operand);
- } else {
- __ str(value, operand);
- }
+ __ str(value, MemOperand(object, offset));
return;
}
@@ -4222,12 +4208,7 @@
instr->hydrogen()->value()->IsHeapObject()
? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
if (access.IsInobject()) {
- MemOperand operand = FieldMemOperand(object, offset);
- if (representation.IsByte()) {
- __ strb(value, operand);
- } else {
- __ str(value, operand);
- }
+ __ str(value, FieldMemOperand(object, offset));
if (instr->hydrogen()->NeedsWriteBarrier()) {
// Update the write barrier for the object for in-object properties.
__ RecordWriteField(object,
@@ -4241,12 +4222,7 @@
}
} else {
__ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
- MemOperand operand = FieldMemOperand(scratch, offset);
- if (representation.IsByte()) {
- __ strb(value, operand);
- } else {
- __ str(value, operand);
- }
+ __ str(value, FieldMemOperand(scratch, offset));
if (instr->hydrogen()->NeedsWriteBarrier()) {
// Update the write barrier for the properties array.
// object is used as a scratch register.
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Wed Oct 2
13:27:53 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Fri Oct 4
05:47:35 2013 UTC
@@ -2829,9 +2829,6 @@
Range* HLoadNamedField::InferRange(Zone* zone) {
- if (access().representation().IsByte()) {
- return new(zone) Range(0, 255);
- }
if (access().IsStringLength()) {
return new(zone) Range(0, String::kMaxLength);
}
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Wed Oct 2 16:13:49
2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri Oct 4 05:47:35
2013 UTC
@@ -5954,9 +5954,7 @@
SetOperandAt(0, object);
Representation representation = access.representation();
- if (representation.IsByte()) {
- set_representation(Representation::Integer32());
- } else if (representation.IsSmi()) {
+ if (representation.IsSmi()) {
set_type(HType::Smi());
set_representation(representation);
} else if (representation.IsDouble() ||
@@ -6254,14 +6252,11 @@
if (index == 0 && access().IsExternalMemory()) {
// object must be external in case of external memory access
return Representation::External();
- } else if (index == 1) {
- if (field_representation().IsByte() ||
- field_representation().IsInteger32()) {
- return Representation::Integer32();
- } else if (field_representation().IsDouble() ||
- field_representation().IsSmi()) {
- return field_representation();
- }
+ } else if (index == 1 &&
+ (field_representation().IsDouble() ||
+ field_representation().IsSmi() ||
+ field_representation().IsInteger32())) {
+ return field_representation();
}
return Representation::Tagged();
}
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Wed Oct 2
13:27:53 2013 UTC
+++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Fri Oct 4
05:47:35 2013 UTC
@@ -3225,15 +3225,12 @@
if (access.IsExternalMemory()) {
Register result = ToRegister(instr->result());
- MemOperand operand = instr->object()->IsConstantOperand()
- ? MemOperand::StaticVariable(ToExternalReference(
- LConstantOperand::cast(instr->object())))
- : MemOperand(ToRegister(instr->object()), offset);
- if (access.representation().IsByte()) {
- ASSERT(instr->hydrogen()->representation().IsInteger32());
- __ movzx_b(result, operand);
+ if (instr->object()->IsConstantOperand()) {
+ ExternalReference external_reference = ToExternalReference(
+ LConstantOperand::cast(instr->object()));
+ __ mov(result, MemOperand::StaticVariable(external_reference));
} else {
- __ mov(result, operand);
+ __ mov(result, MemOperand(ToRegister(instr->object()), offset));
}
return;
}
@@ -3252,15 +3249,11 @@
}
Register result = ToRegister(instr->result());
- if (!access.IsInobject()) {
+ if (access.IsInobject()) {
+ __ mov(result, FieldOperand(object, offset));
+ } else {
__ mov(result, FieldOperand(object, JSObject::kPropertiesOffset));
- object = result;
- }
- if (access.representation().IsByte()) {
- ASSERT(instr->hydrogen()->representation().IsInteger32());
- __ movzx_b(result, FieldOperand(object, offset));
- } else {
- __ mov(result, FieldOperand(object, offset));
+ __ mov(result, FieldOperand(result, offset));
}
}
@@ -4436,18 +4429,10 @@
: MemOperand(ToRegister(instr->object()), offset);
if (instr->value()->IsConstantOperand()) {
LConstantOperand* operand_value =
LConstantOperand::cast(instr->value());
- if (representation.IsByte()) {
- __ mov_b(operand, ToInteger32(operand_value));
- } else {
- __ mov(operand, Immediate(ToInteger32(operand_value)));
- }
+ __ mov(operand, Immediate(ToInteger32(operand_value)));
} else {
Register value = ToRegister(instr->value());
- if (representation.IsByte()) {
- __ mov_b(operand, value);
- } else {
- __ mov(operand, value);
- }
+ __ mov(operand, value);
}
return;
}
@@ -4520,28 +4505,17 @@
__ mov(write_register, FieldOperand(object,
JSObject::kPropertiesOffset));
}
- MemOperand operand = FieldOperand(write_register, offset);
if (instr->value()->IsConstantOperand()) {
LConstantOperand* operand_value =
LConstantOperand::cast(instr->value());
if (operand_value->IsRegister()) {
- Register value = ToRegister(operand_value);
- if (representation.IsByte()) {
- __ mov_b(operand, value);
- } else {
- __ mov(operand, value);
- }
+ __ mov(FieldOperand(write_register, offset),
ToRegister(operand_value));
} else {
Handle<Object> handle_value = ToHandle(operand_value);
ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
- __ mov(operand, handle_value);
+ __ mov(FieldOperand(write_register, offset), handle_value);
}
} else {
- Register value = ToRegister(instr->value());
- if (representation.IsByte()) {
- __ mov_b(operand, value);
- } else {
- __ mov(operand, value);
- }
+ __ mov(FieldOperand(write_register, offset),
ToRegister(instr->value()));
}
if (instr->hydrogen()->NeedsWriteBarrier()) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Oct 2
17:16:27 2013 UTC
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Fri Oct 4
05:47:35 2013 UTC
@@ -2896,12 +2896,7 @@
if (access.IsExternalMemory()) {
Register result = ToRegister(instr->result());
- MemOperand operand = MemOperand(object, offset);
- if (access.representation().IsByte()) {
- __ lb(result, operand);
- } else {
- __ lw(result, operand);
- }
+ __ lw(result, MemOperand(object, offset));
return;
}
@@ -2912,15 +2907,11 @@
}
Register result = ToRegister(instr->result());
- if (!access.IsInobject()) {
- __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
- object = result;
- }
- MemOperand operand = FieldMemOperand(object, offset);
- if (access.representation().IsByte()) {
- __ lb(result, operand);
+ if (access.IsInobject()) {
+ __ lw(result, FieldMemOperand(object, offset));
} else {
- __ lw(result, operand);
+ __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
+ __ lw(result, FieldMemOperand(result, offset));
}
}
@@ -4084,12 +4075,7 @@
if (access.IsExternalMemory()) {
Register value = ToRegister(instr->value());
- MemOperand operand = MemOperand(object, offset);
- if (representation.IsByte()) {
- __ sb(value, operand);
- } else {
- __ sw(value, operand);
- }
+ __ sw(value, MemOperand(object, offset));
return;
}
@@ -4134,12 +4120,7 @@
instr->hydrogen()->value()->IsHeapObject()
? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
if (access.IsInobject()) {
- MemOperand operand = FieldMemOperand(object, offset);
- if (representation.IsByte()) {
- __ sb(value, operand);
- } else {
- __ sw(value, operand);
- }
+ __ sw(value, FieldMemOperand(object, offset));
if (instr->hydrogen()->NeedsWriteBarrier()) {
// Update the write barrier for the object for in-object properties.
__ RecordWriteField(object,
@@ -4153,12 +4134,7 @@
}
} else {
__ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
- MemOperand operand = FieldMemOperand(scratch, offset);
- if (representation.IsByte()) {
- __ sb(value, operand);
- } else {
- __ sw(value, operand);
- }
+ __ sw(value, FieldMemOperand(scratch, offset));
if (instr->hydrogen()->NeedsWriteBarrier()) {
// Update the write barrier for the properties array.
// object is used as a scratch register.
=======================================
--- /branches/bleeding_edge/src/property-details.h Wed Oct 2 13:27:53 2013
UTC
+++ /branches/bleeding_edge/src/property-details.h Fri Oct 4 05:47:35 2013
UTC
@@ -82,7 +82,6 @@
public:
enum Kind {
kNone,
- kByte,
kSmi,
kInteger32,
kDouble,
@@ -96,7 +95,6 @@
static Representation None() { return Representation(kNone); }
static Representation Tagged() { return Representation(kTagged); }
- static Representation Byte() { return Representation(kByte); }
static Representation Smi() { return Representation(kSmi); }
static Representation Integer32() { return Representation(kInteger32); }
static Representation Double() { return Representation(kDouble); }
@@ -141,7 +139,6 @@
Kind kind() const { return static_cast<Kind>(kind_); }
bool IsNone() const { return kind_ == kNone; }
- bool IsByte() const { return kind_ == kByte; }
bool IsTagged() const { return kind_ == kTagged; }
bool IsSmi() const { return kind_ == kSmi; }
bool IsSmiOrTagged() const { return IsSmi() || IsTagged(); }
@@ -151,7 +148,7 @@
bool IsHeapObject() const { return kind_ == kHeapObject; }
bool IsExternal() const { return kind_ == kExternal; }
bool IsSpecialization() const {
- return IsByte() || IsSmi() || IsInteger32() || IsDouble();
+ return kind_ == kInteger32 || kind_ == kDouble || kind_ == kSmi;
}
const char* Mnemonic() const;
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Thu Oct 3
01:22:25 2013 UTC
+++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Fri Oct 4
05:47:35 2013 UTC
@@ -2725,13 +2725,14 @@
int offset = access.offset();
if (access.IsExternalMemory()) {
+ ASSERT(!access.representation().IsInteger32());
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());
- __ Load(result, MemOperand(object, offset), access.representation());
+ __ movq(result, MemOperand(object, offset));
}
return;
}
@@ -2745,11 +2746,20 @@
}
Register result = ToRegister(instr->result());
- if (!access.IsInobject()) {
+ if (access.IsInobject()) {
+ if (access.representation().IsInteger32()) {
+ __ movl(result, FieldOperand(object, offset));
+ } else {
+ __ movq(result, FieldOperand(object, offset));
+ }
+ } else {
__ movq(result, FieldOperand(object, JSObject::kPropertiesOffset));
- object = result;
+ if (access.representation().IsInteger32()) {
+ __ movl(result, FieldOperand(result, offset));
+ } else {
+ __ movq(result, FieldOperand(result, offset));
+ }
}
- __ Load(result, FieldOperand(object, offset), access.representation());
}
@@ -3871,16 +3881,16 @@
int offset = access.offset();
if (access.IsExternalMemory()) {
+ ASSERT(!access.representation().IsInteger32());
ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
Register value = ToRegister(instr->value());
if (instr->object()->IsConstantOperand()) {
ASSERT(value.is(rax));
- ASSERT(!access.representation().IsSpecialization());
LConstantOperand* object = LConstantOperand::cast(instr->object());
__ store_rax(ToExternalReference(object));
} else {
Register object = ToRegister(instr->object());
- __ Store(MemOperand(object, offset), value, representation);
+ __ movq(MemOperand(object, offset), value);
}
return;
}
@@ -3949,16 +3959,24 @@
if (instr->value()->IsConstantOperand()) {
LConstantOperand* operand_value =
LConstantOperand::cast(instr->value());
if (operand_value->IsRegister()) {
- Register value = ToRegister(operand_value);
- __ Store(FieldOperand(write_register, offset), value,
representation);
+ if (access.representation().IsInteger32()) {
+ __ movl(FieldOperand(write_register, offset),
+ ToRegister(operand_value));
+ } else {
+ __ movq(FieldOperand(write_register, offset),
+ ToRegister(operand_value));
+ }
} else {
Handle<Object> handle_value = ToHandle(operand_value);
ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
__ Move(FieldOperand(write_register, offset), handle_value);
}
} else {
- Register value = ToRegister(instr->value());
- __ Store(FieldOperand(write_register, offset), value, representation);
+ if (access.representation().IsInteger32()) {
+ __ movl(FieldOperand(write_register, offset),
ToRegister(instr->value()));
+ } else {
+ __ movq(FieldOperand(write_register, offset),
ToRegister(instr->value()));
+ }
}
if (instr->hydrogen()->NeedsWriteBarrier()) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc Wed Oct 2 15:27:51 2013
UTC
+++ /branches/bleeding_edge/src/x64/lithium-x64.cc Fri Oct 4 05:47:35 2013
UTC
@@ -2060,14 +2060,7 @@
LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
- // Use the special mov rax, moffs64 encoding for external
- // memory accesses with 64-bit word-sized values.
- if (instr->access().IsExternalMemory() &&
- instr->access().offset() == 0 &&
- (instr->access().representation().IsSmi() ||
- instr->access().representation().IsTagged() ||
- instr->access().representation().IsHeapObject() ||
- instr->access().representation().IsExternal())) {
+ if (instr->access().IsExternalMemory() && instr->access().offset() == 0)
{
LOperand* obj = UseRegisterOrConstantAtStart(instr->object());
return DefineFixed(new(zone()) LLoadNamedField(obj), rax);
}
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Thu Oct 3
01:22:25 2013 UTC
+++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Fri Oct 4
05:47:35 2013 UTC
@@ -945,28 +945,6 @@
xorps(dst, dst);
cvtlsi2sd(dst, src);
}
-
-
-void MacroAssembler::Load(Register dst, const Operand& src, Representation
r) {
- if (r.IsByte()) {
- movzxbl(dst, src);
- } else if (r.IsInteger32()) {
- movl(dst, src);
- } else {
- movq(dst, src);
- }
-}
-
-
-void MacroAssembler::Store(const Operand& dst, Register src,
Representation r) {
- if (r.IsByte()) {
- movb(dst, src);
- } else if (r.IsInteger32()) {
- movl(dst, src);
- } else {
- movq(dst, src);
- }
-}
void MacroAssembler::Set(Register dst, int64_t x) {
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.h Wed Oct 2
13:27:53 2013 UTC
+++ /branches/bleeding_edge/src/x64/macro-assembler-x64.h Fri Oct 4
05:47:35 2013 UTC
@@ -781,10 +781,6 @@
//
---------------------------------------------------------------------------
// Macro instructions.
- // Load/store with specific representation.
- void Load(Register dst, const Operand& src, Representation r);
- void Store(const Operand& dst, Register src, Representation r);
-
// Load a register with a long value as efficiently as possible.
void Set(Register dst, int64_t x);
void Set(const Operand& dst, int64_t x);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.