Commit 6c8e9df2 authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Add support to load/store byte fields.

Port r17079 (0885ac2)

Original commit message:
This adds a new Byte representation and support for zero-extended
loads in HLoadNamedField and truncated stores in HStoreNamedField.

BUG=
R=plind44@gmail.com

Review URL: https://codereview.chromium.org/25460003

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17085 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1db15f84
......@@ -2896,7 +2896,12 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
if (access.IsExternalMemory()) {
Register result = ToRegister(instr->result());
__ lw(result, MemOperand(object, offset));
MemOperand operand = MemOperand(object, offset);
if (access.representation().IsByte()) {
__ lb(result, operand);
} else {
__ lw(result, operand);
}
return;
}
......@@ -2907,11 +2912,15 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
}
Register result = ToRegister(instr->result());
if (access.IsInobject()) {
__ lw(result, FieldMemOperand(object, offset));
} else {
if (!access.IsInobject()) {
__ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
__ lw(result, FieldMemOperand(result, offset));
object = result;
}
MemOperand operand = FieldMemOperand(object, offset);
if (access.representation().IsByte()) {
__ lb(result, operand);
} else {
__ lw(result, operand);
}
}
......@@ -4075,7 +4084,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
if (access.IsExternalMemory()) {
Register value = ToRegister(instr->value());
__ sw(value, MemOperand(object, offset));
MemOperand operand = MemOperand(object, offset);
if (representation.IsByte()) {
__ sb(value, operand);
} else {
__ sw(value, operand);
}
return;
}
......@@ -4120,7 +4134,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
instr->hydrogen()->value()->IsHeapObject()
? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
if (access.IsInobject()) {
__ sw(value, FieldMemOperand(object, offset));
MemOperand operand = FieldMemOperand(object, offset);
if (representation.IsByte()) {
__ sb(value, operand);
} else {
__ sw(value, operand);
}
if (instr->hydrogen()->NeedsWriteBarrier()) {
// Update the write barrier for the object for in-object properties.
__ RecordWriteField(object,
......@@ -4134,7 +4153,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
}
} else {
__ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
__ sw(value, FieldMemOperand(scratch, offset));
MemOperand operand = FieldMemOperand(scratch, offset);
if (representation.IsByte()) {
__ sb(value, operand);
} else {
__ sw(value, operand);
}
if (instr->hydrogen()->NeedsWriteBarrier()) {
// Update the write barrier for the properties array.
// object is used as a scratch register.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment