From: mvstanton@chromium.org Date: Thu, 18 Apr 2013 15:44:38 +0000 (+0000) Subject: HArgument instructions currently require a frame. In Lithium we can ensure a frame X-Git-Tag: upstream/4.7.83~14521 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfb3e6ce9c52f52d1625a132c3f98befbdcdb9a6;p=platform%2Fupstream%2Fv8.git HArgument instructions currently require a frame. In Lithium we can ensure a frame is created for these instructions via a compile info flag. BUG= Review URL: https://codereview.chromium.org/14354003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14339 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index 64083e8..1314e78 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -989,12 +989,14 @@ LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* instr) { + info()->MarkAsRequiresFrame(); LOperand* value = UseRegister(instr->value()); return DefineAsRegister(new(zone()) LArgumentsLength(value)); } LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { + info()->MarkAsRequiresFrame(); return DefineAsRegister(new(zone()) LArgumentsElements); } @@ -2456,6 +2458,7 @@ LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { + info()->MarkAsRequiresFrame(); LOperand* args = UseRegister(instr->arguments()); LOperand* length = UseTempRegister(instr->length()); LOperand* index = UseRegister(instr->index()); diff --git a/src/arm/lithium-codegen-arm.h b/src/arm/lithium-codegen-arm.h index c55558c..5f720a9 100644 --- a/src/arm/lithium-codegen-arm.h +++ b/src/arm/lithium-codegen-arm.h @@ -83,7 +83,8 @@ class LCodeGen BASE_EMBEDDED { bool NeedsEagerFrame() const { return GetStackSlotCount() > 0 || info()->is_non_deferred_calling() || - !info()->IsStub(); + !info()->IsStub() || + info()->requires_frame(); } bool NeedsDeferredFrame() const { return !NeedsEagerFrame() && info()->is_deferred_calling(); diff --git a/src/compiler.h b/src/compiler.h index dae39db..00074c8 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -143,6 +143,14 @@ class CompilationInfo { return SavesCallerDoubles::decode(flags_); } + void MarkAsRequiresFrame() { + flags_ |= RequiresFrame::encode(true); + } + + bool requires_frame() const { + return RequiresFrame::decode(flags_); + } + void SetParseRestriction(ParseRestriction restriction) { flags_ = ParseRestricitonField::update(flags_, restriction); } @@ -300,6 +308,8 @@ class CompilationInfo { class SavesCallerDoubles: public BitField {}; // If the set of valid statements is restricted. class ParseRestricitonField: public BitField {}; + // If the function requires a frame (for unspecified reasons) + class RequiresFrame: public BitField {}; unsigned flags_; diff --git a/src/ia32/lithium-codegen-ia32.h b/src/ia32/lithium-codegen-ia32.h index b268456..3e1bc35 100644 --- a/src/ia32/lithium-codegen-ia32.h +++ b/src/ia32/lithium-codegen-ia32.h @@ -87,7 +87,8 @@ class LCodeGen BASE_EMBEDDED { bool NeedsEagerFrame() const { return GetStackSlotCount() > 0 || info()->is_non_deferred_calling() || - !info()->IsStub(); + !info()->IsStub() || + info()->requires_frame(); } bool NeedsDeferredFrame() const { return !NeedsEagerFrame() && info()->is_deferred_calling(); diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index c4a8be1..523673a 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -1056,11 +1056,13 @@ LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { + info()->MarkAsRequiresFrame(); return DefineAsRegister(new(zone()) LArgumentsLength(Use(length->value()))); } LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { + info()->MarkAsRequiresFrame(); return DefineAsRegister(new(zone()) LArgumentsElements); } @@ -2575,6 +2577,7 @@ LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { + info()->MarkAsRequiresFrame(); LOperand* args = UseRegister(instr->arguments()); LOperand* length = UseTempRegister(instr->length()); LOperand* index = Use(instr->index()); diff --git a/src/x64/lithium-codegen-x64.h b/src/x64/lithium-codegen-x64.h index adcc3e5..3cad2cc 100644 --- a/src/x64/lithium-codegen-x64.h +++ b/src/x64/lithium-codegen-x64.h @@ -83,7 +83,8 @@ class LCodeGen BASE_EMBEDDED { bool NeedsEagerFrame() const { return GetStackSlotCount() > 0 || info()->is_non_deferred_calling() || - !info()->IsStub(); + !info()->IsStub() || + info()->requires_frame(); } bool NeedsDeferredFrame() const { return !NeedsEagerFrame() && info()->is_deferred_calling(); diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 1d42455..d365174 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -997,11 +997,13 @@ LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { + info()->MarkAsRequiresFrame(); return DefineAsRegister(new(zone()) LArgumentsLength(Use(length->value()))); } LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { + info()->MarkAsRequiresFrame(); return DefineAsRegister(new(zone()) LArgumentsElements); } @@ -2378,6 +2380,7 @@ LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { + info()->MarkAsRequiresFrame(); LOperand* args = UseRegister(instr->arguments()); LOperand* length = UseTempRegister(instr->length()); LOperand* index = Use(instr->index());