From 49bfbb069ee3b467314dcabfa9723fcbd807b055 Mon Sep 17 00:00:00 2001 From: "plind44@gmail.com" Date: Thu, 19 Sep 2013 15:38:51 +0000 Subject: [PATCH] MIPS: Add HLoadRoot hydrogen instruction. Port r16807 (257f48f) BUG= R=plind44@gmail.com Review URL: https://codereview.chromium.org/24134004 Patch from Balazs Kilvady . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16840 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/lithium-codegen-mips.cc | 6 ++++++ src/mips/lithium-mips.cc | 5 +++++ src/mips/lithium-mips.h | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 80c2051..6f82e1b 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -3002,6 +3002,12 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { } +void LCodeGen::DoLoadRoot(LLoadRoot* instr) { + Register result = ToRegister(instr->result()); + __ LoadRoot(result, instr->index()); +} + + void LCodeGen::DoLoadExternalArrayPointer( LLoadExternalArrayPointer* instr) { Register to_reg = ToRegister(instr->result()); diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 7da9245..7333398 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -2071,6 +2071,11 @@ LInstruction* LChunkBuilder::DoLoadFunctionPrototype( } +LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { + return DefineAsRegister(new(zone()) LLoadRoot); +} + + LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( HLoadExternalArrayPointer* instr) { LOperand* input = UseRegisterAtStart(instr->value()); diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index 3ab8f37..cfc0909 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -119,6 +119,7 @@ class LCodeGen; V(LazyBailout) \ V(LoadContextSlot) \ V(LoadExternalArrayPointer) \ + V(LoadRoot) \ V(LoadFieldByIndex) \ V(LoadFunctionPrototype) \ V(LoadGlobalCell) \ @@ -1559,6 +1560,15 @@ class LLoadFunctionPrototype V8_FINAL : public LTemplateInstruction<1, 1, 0> { }; +class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { + public: + DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") + DECLARE_HYDROGEN_ACCESSOR(LoadRoot) + + Heap::RootListIndex index() const { return hydrogen()->index(); } +}; + + class LLoadExternalArrayPointer V8_FINAL : public LTemplateInstruction<1, 1, 0> { public: -- 2.7.4