From 478aa96d6f0086aec900a670c99e44af91596ae5 Mon Sep 17 00:00:00 2001 From: "titzer@chromium.org" Date: Wed, 23 Oct 2013 16:57:57 +0000 Subject: [PATCH] Handle new space constants on ia32 by using in a register in Lithium. BUG= R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/35413008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17347 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ia32/lithium-ia32.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 1c13e83..0800823 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -561,29 +561,34 @@ LOperand* LChunkBuilder::UseAtStart(HValue* value) { } +static inline bool CanBeImmediateConstant(HValue* value) { + return value->IsConstant() && HConstant::cast(value)->NotInNewSpace(); +} + + LOperand* LChunkBuilder::UseOrConstant(HValue* value) { - return value->IsConstant() + return CanBeImmediateConstant(value) ? chunk_->DefineConstantOperand(HConstant::cast(value)) : Use(value); } LOperand* LChunkBuilder::UseOrConstantAtStart(HValue* value) { - return value->IsConstant() + return CanBeImmediateConstant(value) ? chunk_->DefineConstantOperand(HConstant::cast(value)) : UseAtStart(value); } LOperand* LChunkBuilder::UseRegisterOrConstant(HValue* value) { - return value->IsConstant() + return CanBeImmediateConstant(value) ? chunk_->DefineConstantOperand(HConstant::cast(value)) : UseRegister(value); } LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) { - return value->IsConstant() + return CanBeImmediateConstant(value) ? chunk_->DefineConstantOperand(HConstant::cast(value)) : UseRegisterAtStart(value); } -- 2.7.4