From e318155c6ea9bf2e2030f5c576240ffec5be3a53 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Wed, 12 Dec 2012 12:51:47 +0000 Subject: [PATCH] Revert "Remove redundant loads in DoCheckMaps" This reverts r13200. TBR=svenpanne@chromium.org Review URL: https://codereview.chromium.org/11552017 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13206 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-codegen-arm.cc | 25 ++++++++++++------------- src/arm/lithium-codegen-arm.h | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index a8f3cb2..06b0216 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -4945,33 +4945,33 @@ void LCodeGen::DoCheckFunction(LCheckFunction* instr) { } -void LCodeGen::DoCheckMapCommon(Register map_reg, +void LCodeGen::DoCheckMapCommon(Register reg, + Register scratch, Handle map, CompareMapMode mode, LEnvironment* env) { Label success; - __ CompareMap(map_reg, map, &success, mode); + __ CompareMap(reg, scratch, map, &success, mode); DeoptimizeIf(ne, env); __ bind(&success); } void LCodeGen::DoCheckMaps(LCheckMaps* instr) { - Register map_reg = scratch0(); + Register scratch = scratch0(); LOperand* input = instr->value(); ASSERT(input->IsRegister()); Register reg = ToRegister(input); Label success; SmallMapList* map_set = instr->hydrogen()->map_set(); - __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); for (int i = 0; i < map_set->length() - 1; i++) { Handle map = map_set->at(i); - __ CompareMap(map_reg, map, &success, REQUIRE_EXACT_MAP); + __ CompareMap(reg, scratch, map, &success, REQUIRE_EXACT_MAP); __ b(eq, &success); } Handle map = map_set->last(); - DoCheckMapCommon(map_reg, map, REQUIRE_EXACT_MAP, instr->environment()); + DoCheckMapCommon(reg, scratch, map, REQUIRE_EXACT_MAP, instr->environment()); __ bind(&success); } @@ -5030,29 +5030,28 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { ASSERT(instr->temp()->Equals(instr->result())); - Register prototype_reg = ToRegister(instr->temp()); - Register map_reg = ToRegister(instr->temp2()); + Register temp1 = ToRegister(instr->temp()); + Register temp2 = ToRegister(instr->temp2()); Handle holder = instr->holder(); Handle current_prototype = instr->prototype(); // Load prototype object. - __ LoadHeapObject(prototype_reg, current_prototype); + __ LoadHeapObject(temp1, current_prototype); // Check prototype maps up to the holder. while (!current_prototype.is_identical_to(holder)) { - __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); - DoCheckMapCommon(map_reg, + DoCheckMapCommon(temp1, temp2, Handle(current_prototype->map()), ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); current_prototype = Handle(JSObject::cast(current_prototype->GetPrototype())); // Load next prototype object. - __ LoadHeapObject(prototype_reg, current_prototype); + __ LoadHeapObject(temp1, current_prototype); } // Check the holder map. - DoCheckMapCommon(map_reg, + DoCheckMapCommon(temp1, temp2, Handle(current_prototype->map()), ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); } diff --git a/src/arm/lithium-codegen-arm.h b/src/arm/lithium-codegen-arm.h index 810a4d3..921285b 100644 --- a/src/arm/lithium-codegen-arm.h +++ b/src/arm/lithium-codegen-arm.h @@ -131,7 +131,7 @@ class LCodeGen BASE_EMBEDDED { void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, Label* map_check); - void DoCheckMapCommon(Register map_reg, Handle map, + void DoCheckMapCommon(Register reg, Register scratch, Handle map, CompareMapMode mode, LEnvironment* env); // Parallel move support. -- 2.7.4