From 3fcbb8f1d0c03022874b3b7bcf4ef364c5c3d661 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 23 Jan 2013 14:01:11 +0000 Subject: [PATCH] MIPS: Make HCheckPrototypeMaps compatible with parallel recompilation. Port r13454 (2c0dd0ff) Original commit message: HCheckPrototypeMaps currently records the prototype and the holder of the prototype chain (both ends of the chain) and assumes that the chain elements and their maps did not change in during the entirety of Crankshaft. The actual traversal of the prototype chain happens in Lithium at code generation. With parallel compilation, this assumption is not longer correct. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/12036030 Patch from Akos Palfi . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13476 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/lithium-codegen-mips.cc | 28 +++++++++------------------- src/mips/lithium-mips.h | 6 ++++-- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 33a32e7..054ca15 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -5005,29 +5005,19 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { Register prototype_reg = ToRegister(instr->temp()); Register map_reg = ToRegister(instr->temp2()); - Handle holder = instr->holder(); - Handle current_prototype = instr->prototype(); + ZoneList >* prototypes = instr->prototypes(); + ZoneList >* maps = instr->maps(); - // Load prototype object. - __ LoadHeapObject(prototype_reg, current_prototype); + ASSERT(prototypes->length() == maps->length()); - // Check prototype maps up to the holder. - while (!current_prototype.is_identical_to(holder)) { + for (int i = 0; i < prototypes->length(); i++) { + __ LoadHeapObject(prototype_reg, prototypes->at(i)); __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); DoCheckMapCommon(map_reg, - 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); - } - - // Check the holder map. - __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); - DoCheckMapCommon(map_reg, - Handle(current_prototype->map()), - ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); + maps->at(i), + ALLOW_ELEMENT_TRANSITION_MAPS, + instr->environment()); + } } diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index a9116ef..fb24632 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -2130,8 +2130,10 @@ class LCheckPrototypeMaps: public LTemplateInstruction<1, 0, 2> { DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) - Handle prototype() const { return hydrogen()->prototype(); } - Handle holder() const { return hydrogen()->holder(); } + ZoneList >* prototypes() const { + return hydrogen()->prototypes(); + } + ZoneList >* maps() const { return hydrogen()->maps(); } }; -- 2.7.4