From 6142c7f8726bdf4a4ebc6246d7a18b1c9961c5b6 Mon Sep 17 00:00:00 2001 From: "balazs.kilvady" Date: Wed, 18 Mar 2015 09:05:20 -0700 Subject: [PATCH] MIPS: Remove PropertyCell space. Port 16c8485a35efc36cf6ccd15185282d65412e1502 Original commit message: Replaces StoreGlobalCell / LoadGlobalCell with NamedField variants that use write barriers. BUG= Review URL: https://codereview.chromium.org/1014293002 Cr-Commit-Position: refs/heads/master@{#27277} --- src/mips/lithium-codegen-mips.cc | 37 ------------------------------------ src/mips/lithium-mips.cc | 18 ------------------ src/mips/lithium-mips.h | 24 ----------------------- src/mips64/lithium-codegen-mips64.cc | 36 ----------------------------------- src/mips64/lithium-mips64.cc | 18 ------------------ src/mips64/lithium-mips64.h | 24 ----------------------- 6 files changed, 157 deletions(-) diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 6673a86..edf467e 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -2902,17 +2902,6 @@ void LCodeGen::DoReturn(LReturn* instr) { } -void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { - Register result = ToRegister(instr->result()); - __ li(at, Operand(Handle(instr->hydrogen()->cell().handle()))); - __ lw(result, FieldMemOperand(at, Cell::kValueOffset)); - if (instr->hydrogen()->RequiresHoleCheck()) { - __ LoadRoot(at, Heap::kTheHoleValueRootIndex); - DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); - } -} - - template void LCodeGen::EmitVectorLoadICRegisters(T* instr) { DCHECK(FLAG_vector_ics); @@ -2948,32 +2937,6 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { } -void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { - Register value = ToRegister(instr->value()); - Register cell = scratch0(); - - // Load the cell. - __ li(cell, Operand(instr->hydrogen()->cell().handle())); - - // If the cell we are storing to contains the hole it could have - // been deleted from the property dictionary. In that case, we need - // to update the property details in the property dictionary to mark - // it as no longer deleted. - if (instr->hydrogen()->RequiresHoleCheck()) { - // We use a temp to check the payload. - Register payload = ToRegister(instr->temp()); - __ lw(payload, FieldMemOperand(cell, Cell::kValueOffset)); - __ LoadRoot(at, Heap::kTheHoleValueRootIndex); - DeoptimizeIf(eq, instr, Deoptimizer::kHole, payload, Operand(at)); - } - - // Store the value. - __ sw(value, FieldMemOperand(cell, Cell::kValueOffset)); - // Cells are always rescanned, so no write barrier here. -} - - - void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { Register context = ToRegister(instr->context()); Register result = ToRegister(instr->result()); diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 8d1b45f..b710ef9 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -2087,14 +2087,6 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { } -LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { - LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; - return instr->RequiresHoleCheck() - ? AssignEnvironment(DefineAsRegister(result)) - : DefineAsRegister(result); -} - - LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* global_object = @@ -2109,16 +2101,6 @@ LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { } -LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { - LOperand* value = UseRegister(instr->value()); - // Use a temp to check the value in the cell in the case where we perform - // a hole check. - return instr->RequiresHoleCheck() - ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) - : new(zone()) LStoreGlobalCell(value, NULL); -} - - LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { LOperand* context = UseRegisterAtStart(instr->value()); LInstruction* result = diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index 1ccba14..ede4cbe 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -100,7 +100,6 @@ class LCodeGen; V(LoadRoot) \ V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ - V(LoadGlobalCell) \ V(LoadGlobalGeneric) \ V(LoadKeyed) \ V(LoadKeyedGeneric) \ @@ -141,7 +140,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreFrameContext) \ - V(StoreGlobalCell) \ V(StoreKeyed) \ V(StoreKeyedGeneric) \ V(StoreNamedField) \ @@ -1667,13 +1665,6 @@ class LLoadKeyedGeneric FINAL : public LTemplateInstruction<1, 3, 1> { }; -class LLoadGlobalCell FINAL : public LTemplateInstruction<1, 0, 0> { - public: - DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell") - DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell) -}; - - class LLoadGlobalGeneric FINAL : public LTemplateInstruction<1, 2, 1> { public: LLoadGlobalGeneric(LOperand* context, LOperand* global_object, @@ -1695,21 +1686,6 @@ class LLoadGlobalGeneric FINAL : public LTemplateInstruction<1, 2, 1> { }; -class LStoreGlobalCell FINAL : public LTemplateInstruction<0, 1, 1> { - public: - LStoreGlobalCell(LOperand* value, LOperand* temp) { - inputs_[0] = value; - temps_[0] = temp; - } - - LOperand* value() { return inputs_[0]; } - LOperand* temp() { return temps_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") - DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) -}; - - class LLoadContextSlot FINAL : public LTemplateInstruction<1, 1, 0> { public: explicit LLoadContextSlot(LOperand* context) { diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc index 114933f..9efa078 100644 --- a/src/mips64/lithium-codegen-mips64.cc +++ b/src/mips64/lithium-codegen-mips64.cc @@ -2879,17 +2879,6 @@ void LCodeGen::DoReturn(LReturn* instr) { } -void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { - Register result = ToRegister(instr->result()); - __ li(at, Operand(Handle(instr->hydrogen()->cell().handle()))); - __ ld(result, FieldMemOperand(at, Cell::kValueOffset)); - if (instr->hydrogen()->RequiresHoleCheck()) { - __ LoadRoot(at, Heap::kTheHoleValueRootIndex); - DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); - } -} - - template void LCodeGen::EmitVectorLoadICRegisters(T* instr) { DCHECK(FLAG_vector_ics); @@ -2925,31 +2914,6 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { } -void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { - Register value = ToRegister(instr->value()); - Register cell = scratch0(); - - // Load the cell. - __ li(cell, Operand(instr->hydrogen()->cell().handle())); - - // If the cell we are storing to contains the hole it could have - // been deleted from the property dictionary. In that case, we need - // to update the property details in the property dictionary to mark - // it as no longer deleted. - if (instr->hydrogen()->RequiresHoleCheck()) { - // We use a temp to check the payload. - Register payload = ToRegister(instr->temp()); - __ ld(payload, FieldMemOperand(cell, Cell::kValueOffset)); - __ LoadRoot(at, Heap::kTheHoleValueRootIndex); - DeoptimizeIf(eq, instr, Deoptimizer::kHole, payload, Operand(at)); - } - - // Store the value. - __ sd(value, FieldMemOperand(cell, Cell::kValueOffset)); - // Cells are always rescanned, so no write barrier here. -} - - void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { Register context = ToRegister(instr->context()); Register result = ToRegister(instr->result()); diff --git a/src/mips64/lithium-mips64.cc b/src/mips64/lithium-mips64.cc index 1e48881..60a837e 100644 --- a/src/mips64/lithium-mips64.cc +++ b/src/mips64/lithium-mips64.cc @@ -2085,14 +2085,6 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { } -LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { - LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; - return instr->RequiresHoleCheck() - ? AssignEnvironment(DefineAsRegister(result)) - : DefineAsRegister(result); -} - - LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* global_object = @@ -2107,16 +2099,6 @@ LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { } -LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { - LOperand* value = UseRegister(instr->value()); - // Use a temp to check the value in the cell in the case where we perform - // a hole check. - return instr->RequiresHoleCheck() - ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) - : new(zone()) LStoreGlobalCell(value, NULL); -} - - LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { LOperand* context = UseRegisterAtStart(instr->value()); LInstruction* result = diff --git a/src/mips64/lithium-mips64.h b/src/mips64/lithium-mips64.h index afc84ef..6eed2c2 100644 --- a/src/mips64/lithium-mips64.h +++ b/src/mips64/lithium-mips64.h @@ -100,7 +100,6 @@ class LCodeGen; V(LoadRoot) \ V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ - V(LoadGlobalCell) \ V(LoadGlobalGeneric) \ V(LoadKeyed) \ V(LoadKeyedGeneric) \ @@ -140,7 +139,6 @@ class LCodeGen; V(StoreCodeEntry) \ V(StoreContextSlot) \ V(StoreFrameContext) \ - V(StoreGlobalCell) \ V(StoreKeyed) \ V(StoreKeyedGeneric) \ V(StoreNamedField) \ @@ -1665,13 +1663,6 @@ class LLoadKeyedGeneric FINAL : public LTemplateInstruction<1, 3, 1> { }; -class LLoadGlobalCell FINAL : public LTemplateInstruction<1, 0, 0> { - public: - DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell") - DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell) -}; - - class LLoadGlobalGeneric FINAL : public LTemplateInstruction<1, 2, 1> { public: LLoadGlobalGeneric(LOperand* context, LOperand* global_object, @@ -1693,21 +1684,6 @@ class LLoadGlobalGeneric FINAL : public LTemplateInstruction<1, 2, 1> { }; -class LStoreGlobalCell FINAL : public LTemplateInstruction<0, 1, 1> { - public: - LStoreGlobalCell(LOperand* value, LOperand* temp) { - inputs_[0] = value; - temps_[0] = temp; - } - - LOperand* value() { return inputs_[0]; } - LOperand* temp() { return temps_[0]; } - - DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") - DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) -}; - - class LLoadContextSlot FINAL : public LTemplateInstruction<1, 1, 0> { public: explicit LLoadContextSlot(LOperand* context) { -- 2.7.4