__ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
if (depth != 1 || check == CHECK_ALL_MAPS) {
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
- __ CmpWeakValue(scratch2, map_reg, cell);
- __ Branch(miss, ne, scratch2, Operand(zero_reg));
+ __ GetWeakValue(scratch2, cell);
+ __ Branch(miss, ne, scratch2, Operand(map_reg));
}
// Check access rights to the global object. This has to happen after
// Check the holder map.
__ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
- __ CmpWeakValue(scratch2, scratch1, cell);
- __ Branch(miss, ne, scratch2, Operand(zero_reg));
+ __ GetWeakValue(scratch2, cell);
+ __ Branch(miss, ne, scratch2, Operand(scratch1));
}
// Perform security check for access to the global object.
__ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
if (depth != 1 || check == CHECK_ALL_MAPS) {
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
- __ CmpWeakValue(scratch2, map_reg, cell);
- __ Branch(miss, ne, scratch2, Operand(zero_reg));
+ __ GetWeakValue(scratch2, cell);
+ __ Branch(miss, ne, scratch2, Operand(map_reg));
}
// Check access rights to the global object. This has to happen after
// Check the holder map.
__ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
- __ CmpWeakValue(scratch2, scratch1, cell);
- __ Branch(miss, ne, scratch2, Operand(zero_reg));
+ __ GetWeakValue(scratch2, cell);
+ __ Branch(miss, ne, scratch2, Operand(scratch1));
}
// Perform security check for access to the global object.
}
-void MacroAssembler::CmpWeakValue(Register match, Register value,
- Handle<WeakCell> cell) {
- li(match, Operand(cell));
- lw(match, FieldMemOperand(match, WeakCell::kValueOffset));
- Subu(match, value, match);
+void MacroAssembler::GetWeakValue(Register value, Handle<WeakCell> cell) {
+ li(value, Operand(cell));
+ lw(value, FieldMemOperand(value, WeakCell::kValueOffset));
}
void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell,
Label* miss) {
- li(value, Operand(cell));
- lw(value, FieldMemOperand(value, WeakCell::kValueOffset));
+ GetWeakValue(value, cell);
JumpIfSmi(value, miss);
}
Handle<Code> success,
SmiCheckType smi_check_type);
- // Compare the given value and the value of the weak cell. Write the result
- // to the match register.
- void CmpWeakValue(Register match, Register value, Handle<WeakCell> cell);
+ // Get value of the weak cell.
+ void GetWeakValue(Register value, Handle<WeakCell> cell);
// Load the value of the weak cell in the value register. Branch to the
// given miss label is the weak cell was cleared.
}
-void MacroAssembler::CmpWeakValue(Register match, Register value,
- Handle<WeakCell> cell) {
- li(match, Operand(cell));
- ld(match, FieldMemOperand(match, WeakCell::kValueOffset));
- Dsubu(match, value, match);
+void MacroAssembler::GetWeakValue(Register value, Handle<WeakCell> cell) {
+ li(value, Operand(cell));
+ ld(value, FieldMemOperand(value, WeakCell::kValueOffset));
}
void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell,
Label* miss) {
- li(value, Operand(cell));
- ld(value, FieldMemOperand(value, WeakCell::kValueOffset));
+ GetWeakValue(value, cell);
JumpIfSmi(value, miss);
}
Handle<Code> success,
SmiCheckType smi_check_type);
- // Compare the given value and the value of the weak cell. Write the result
- // to the match register.
- void CmpWeakValue(Register match, Register value, Handle<WeakCell> cell);
+ // Get value of the weak cell.
+ void GetWeakValue(Register value, Handle<WeakCell> cell);
// Load the value of the weak cell in the value register. Branch to the
// given miss label is the weak cell was cleared.