Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index 494d9474f96a4038e07a51dc6358ac464647cfa3..675dc13e523677b6515092d15f33371152f6913b 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -287,12 +287,15 @@ static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow, |
// Smis. If it's not a heap number, then return equal. |
__ GetObjectType(a0, t0, t0); |
if (cc == less || cc == greater) { |
+ Label not_simd; |
// Call runtime on identical JSObjects. |
__ Branch(slow, greater, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); |
// Call runtime on identical symbols since we need to throw a TypeError. |
__ Branch(slow, eq, t0, Operand(SYMBOL_TYPE)); |
// Call runtime on identical SIMD values since we must throw a TypeError. |
- __ Branch(slow, eq, t0, Operand(FLOAT32X4_TYPE)); |
+ __ Branch(¬_simd, lt, t0, Operand(FIRST_SIMD_VALUE_TYPE)); |
+ __ Branch(slow, le, t0, Operand(LAST_SIMD_VALUE_TYPE)); |
+ __ bind(¬_simd); |
if (is_strong(strength)) { |
// Call the runtime on anything that is converted in the semantics, since |
// we need to throw a TypeError. Smis have already been ruled out. |
@@ -301,6 +304,7 @@ static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow, |
__ Branch(slow, ne, t0, Operand(zero_reg)); |
} |
} else { |
+ Label not_simd; |
__ Branch(&heap_number, eq, t0, Operand(HEAP_NUMBER_TYPE)); |
// Comparing JS objects with <=, >= is complicated. |
if (cc != eq) { |
@@ -308,7 +312,9 @@ static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow, |
// Call runtime on identical symbols since we need to throw a TypeError. |
__ Branch(slow, eq, t0, Operand(SYMBOL_TYPE)); |
// Call runtime on identical SIMD values since we must throw a TypeError. |
- __ Branch(slow, eq, t0, Operand(FLOAT32X4_TYPE)); |
+ __ Branch(¬_simd, lt, t0, Operand(FIRST_SIMD_VALUE_TYPE)); |
+ __ Branch(slow, le, t0, Operand(LAST_SIMD_VALUE_TYPE)); |
+ __ bind(¬_simd); |
if (is_strong(strength)) { |
// Call the runtime on anything that is converted in the semantics, |
// since we need to throw a TypeError. Smis and heap numbers have |
@@ -5304,19 +5310,21 @@ void InternalArrayConstructorStub::Generate(MacroAssembler* masm) { |
void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { |
Register context_reg = cp; |
Register slot_reg = a2; |
+ Register name_reg = a3; |
Register result_reg = v0; |
Label slow_case; |
// Go up context chain to the script context. |
for (int i = 0; i < depth(); ++i) { |
- __ ld(result_reg, ContextOperand(context_reg, Context::PREVIOUS_INDEX)); |
+ __ lw(result_reg, ContextOperand(context_reg, Context::PREVIOUS_INDEX)); |
context_reg = result_reg; |
} |
// Load the PropertyCell value at the specified slot. |
__ dsll(at, slot_reg, kPointerSizeLog2); |
__ Daddu(at, at, Operand(context_reg)); |
- __ ld(result_reg, ContextOperand(at, 0)); |
+ __ Daddu(at, at, Context::SlotOffset(0)); |
+ __ ld(result_reg, MemOperand(at)); |
__ ld(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset)); |
// Check that value is not the_hole. |
@@ -5327,23 +5335,24 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Fallback to the runtime. |
__ bind(&slow_case); |
__ SmiTag(slot_reg); |
- __ Push(slot_reg); |
- __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 1, 1); |
+ __ Push(slot_reg, name_reg); |
+ __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1); |
} |
void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
Register context_reg = cp; |
Register slot_reg = a2; |
+ Register name_reg = a3; |
Register value_reg = a0; |
Register cell_reg = a4; |
- Register cell_value_reg = a5; |
- Register cell_details_reg = a6; |
+ Register cell_details_reg = a5; |
Label fast_heapobject_case, fast_smi_case, slow_case; |
if (FLAG_debug_code) { |
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
__ Check(ne, kUnexpectedValue, value_reg, Operand(at)); |
+ __ AssertName(name_reg); |
} |
// Go up context chain to the script context. |
@@ -5355,7 +5364,8 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Load the PropertyCell at the specified slot. |
__ dsll(at, slot_reg, kPointerSizeLog2); |
__ Daddu(at, at, Operand(context_reg)); |
- __ ld(cell_reg, ContextOperand(at, 0)); |
+ __ Daddu(at, at, Context::SlotOffset(0)); |
+ __ ld(cell_reg, MemOperand(at)); |
// Load PropertyDetails for the cell (actually only the cell_type and kind). |
__ ld(cell_details_reg, |
@@ -5363,8 +5373,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
__ SmiUntag(cell_details_reg); |
__ And(cell_details_reg, cell_details_reg, |
PropertyDetails::PropertyCellTypeField::kMask | |
- PropertyDetails::KindField::kMask | |
- PropertyDetails::kAttributesReadOnlyMask); |
+ PropertyDetails::KindField::kMask); |
// Check if PropertyCell holds mutable data. |
Label not_mutable_data; |
@@ -5386,11 +5395,8 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Check if PropertyCell value matches the new value (relevant for Constant, |
// ConstantType and Undefined cells). |
Label not_same_value; |
- __ ld(cell_value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); |
- __ Branch(¬_same_value, ne, value_reg, Operand(cell_value_reg)); |
- // Make sure the PropertyCell is not marked READ_ONLY. |
- __ And(at, cell_details_reg, PropertyDetails::kAttributesReadOnlyMask); |
- __ Branch(&slow_case, ne, at, Operand(zero_reg)); |
+ __ ld(at, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); |
+ __ Branch(¬_same_value, ne, value_reg, Operand(at)); |
if (FLAG_debug_code) { |
Label done; |
// This can only be true for Constant, ConstantType and Undefined cells, |
@@ -5412,8 +5418,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
__ Ret(); |
__ bind(¬_same_value); |
- // Check if PropertyCell contains data with constant type (and is not |
- // READ_ONLY). |
+ // Check if PropertyCell contains data with constant type. |
__ Branch(&slow_case, ne, cell_details_reg, |
Operand(PropertyDetails::PropertyCellTypeField::encode( |
PropertyCellType::kConstantType) | |
@@ -5422,6 +5427,8 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Now either both old and new values must be SMIs or both must be heap |
// objects with same map. |
Label value_is_heap_object; |
+ Register cell_value_reg = cell_details_reg; |
+ __ ld(cell_value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); |
__ JumpIfNotSmi(value_reg, &value_is_heap_object); |
__ JumpIfNotSmi(cell_value_reg, &slow_case); |
// Old and new values are SMIs, no need for a write barrier here. |
@@ -5439,11 +5446,11 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Fallback to the runtime. |
__ bind(&slow_case); |
__ SmiTag(slot_reg); |
- __ Push(slot_reg, value_reg); |
+ __ Push(slot_reg, name_reg, value_reg); |
__ TailCallRuntime(is_strict(language_mode()) |
? Runtime::kStoreGlobalViaContext_Strict |
: Runtime::kStoreGlobalViaContext_Sloppy, |
- 2, 1); |
+ 3, 1); |
} |