Reviewers: danno, paul.l..., gergely.kis.imgtec, akos.palfi.imgtec,
dusmil.imgtec,
Description:
MIPS: Change CmpWeakValue to a more MIPS like GetWeakValue.
BUG=
Please review this at https://codereview.chromium.org/779793004/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+20, -28 lines):
M src/ic/mips/handler-compiler-mips.cc
M src/ic/mips64/handler-compiler-mips64.cc
M src/mips/macro-assembler-mips.h
M src/mips/macro-assembler-mips.cc
M src/mips64/macro-assembler-mips64.h
M src/mips64/macro-assembler-mips64.cc
Index: src/ic/mips/handler-compiler-mips.cc
diff --git a/src/ic/mips/handler-compiler-mips.cc
b/src/ic/mips/handler-compiler-mips.cc
index
6bfc5d7fbc940e277015a508b8049fc5b9a83450..3167dea9d326a134bf029946d306fbbfdd737f50
100644
--- a/src/ic/mips/handler-compiler-mips.cc
+++ b/src/ic/mips/handler-compiler-mips.cc
@@ -419,8 +419,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
__ 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
@@ -453,8 +453,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
// 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.
Index: src/ic/mips64/handler-compiler-mips64.cc
diff --git a/src/ic/mips64/handler-compiler-mips64.cc
b/src/ic/mips64/handler-compiler-mips64.cc
index
9d63460154ec76c4c169b37f09b9e506fa75f889..6a35d6c17475ba66d4a0a7579e241f1e220208ee
100644
--- a/src/ic/mips64/handler-compiler-mips64.cc
+++ b/src/ic/mips64/handler-compiler-mips64.cc
@@ -420,8 +420,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
__ 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
@@ -454,8 +454,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
// 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.
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc
b/src/mips/macro-assembler-mips.cc
index
9cd9afa71a9ab86506ae7b78bd50c1f6ef9c59b8..78a583f5b0e1e9d8bad7a9583b82d584d7df55f4
100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -4027,18 +4027,15 @@ void MacroAssembler::CheckMap(Register obj,
}
-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);
}
Index: src/mips/macro-assembler-mips.h
diff --git a/src/mips/macro-assembler-mips.h
b/src/mips/macro-assembler-mips.h
index
a712dbd1500c8410ecf04b3b66be3b880c30cc33..7a2c209514c90e240ef6a8186c4d7a32e9a57cf3
100644
--- a/src/mips/macro-assembler-mips.h
+++ b/src/mips/macro-assembler-mips.h
@@ -1089,9 +1089,8 @@ class MacroAssembler: public Assembler {
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.
Index: src/mips64/macro-assembler-mips64.cc
diff --git a/src/mips64/macro-assembler-mips64.cc
b/src/mips64/macro-assembler-mips64.cc
index
c68f3e5a7819f69ab1d8d0d52fce913c45c4900e..f04331d0e2fb88559643ef3baf37f5926c9722a0
100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -3994,18 +3994,15 @@ void MacroAssembler::CheckMap(Register obj,
}
-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);
}
Index: src/mips64/macro-assembler-mips64.h
diff --git a/src/mips64/macro-assembler-mips64.h
b/src/mips64/macro-assembler-mips64.h
index
b0316d1fb0f1f6bad72eb18590f5c7979c8f51cb..1cc3f9589d61d7590dc893013daba2dd9e59a083
100644
--- a/src/mips64/macro-assembler-mips64.h
+++ b/src/mips64/macro-assembler-mips64.h
@@ -1119,9 +1119,8 @@ class MacroAssembler: public Assembler {
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.
--
--
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/d/optout.