Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: src/ic/mips/ic-compiler-mips.cc

Issue 753993003: Use weak cells in map checks in polymorphic ICs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ia32/ic-compiler-ia32.cc ('k') | src/ic/mips64/ic-compiler-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/mips/ic-compiler-mips.cc
diff --git a/src/ic/mips/ic-compiler-mips.cc b/src/ic/mips/ic-compiler-mips.cc
index c1e67f9ab6169eac7ba25c5bc80846c40c401d2f..fd8e6fa8e06be8dde57143cf09b6c5df7c4df602 100644
--- a/src/ic/mips/ic-compiler-mips.cc
+++ b/src/ic/mips/ic-compiler-mips.cc
@@ -57,7 +57,8 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
number_of_handled_maps++;
// Check map and tail call if there's a match.
// Separate compare from branch, to provide path for above JumpIfSmi().
- __ Subu(match, map_reg, Operand(map));
+ Handle<WeakCell> cell = Map::WeakCellForMap(map);
+ __ CmpWeakValue(match, map_reg, cell);
if (type->Is(HeapType::Number())) {
DCHECK(!number_case.is_unused());
__ bind(&number_case);
@@ -85,15 +86,20 @@ Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic(
__ JumpIfSmi(receiver(), &miss);
int receiver_count = receiver_maps->length();
- __ lw(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset));
+ Register map_reg = scratch1();
+ Register match = scratch2();
+ __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
for (int i = 0; i < receiver_count; ++i) {
+ Handle<WeakCell> cell = Map::WeakCellForMap(receiver_maps->at(i));
+ __ CmpWeakValue(match, map_reg, cell);
if (transitioned_maps->at(i).is_null()) {
- __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq, scratch1(),
- Operand(receiver_maps->at(i)));
+ __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq, match,
+ Operand(zero_reg));
} else {
Label next_map;
- __ Branch(&next_map, ne, scratch1(), Operand(receiver_maps->at(i)));
- __ li(transition_map(), Operand(transitioned_maps->at(i)));
+ __ Branch(&next_map, ne, match, Operand(zero_reg));
+ Handle<WeakCell> cell = Map::WeakCellForMap(transitioned_maps->at(i));
+ __ LoadWeakValue(transition_map(), cell, &miss);
__ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET);
__ bind(&next_map);
}
« no previous file with comments | « src/ic/ia32/ic-compiler-ia32.cc ('k') | src/ic/mips64/ic-compiler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698