From: plind44@gmail.com Date: Mon, 17 Mar 2014 18:27:44 +0000 (+0000) Subject: MIPS: Utility functions for pretenure call new. X-Git-Tag: upstream/4.7.83~10211 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9337a45ab306a19ceaecfb0489eaeee09c698bd2;p=platform%2Fupstream%2Fv8.git MIPS: Utility functions for pretenure call new. Port r19998 (6b07a42) Original commit message: These functions aren't yet called in the tree but will be in the next days. AssertUndefinedOrAllocationSite is to be used in several places where AllocationSite feedback is optional. BUG= R=plind44@gmail.com Review URL: https://codereview.chromium.org/196423018 Patch from Balazs Kilvady . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20014 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index 0538cd4..279eba3 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -4817,6 +4817,23 @@ void MacroAssembler::AssertName(Register object) { } +void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, + Register scratch) { + if (emit_debug_code()) { + Label done_checking; + AssertNotSmi(object); + LoadRoot(scratch, Heap::kUndefinedValueRootIndex); + Branch(&done_checking, eq, object, Operand(scratch)); + push(object); + lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); + LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex); + Assert(eq, kExpectedUndefinedOrCell, object, Operand(scratch)); + pop(object); + bind(&done_checking); + } +} + + void MacroAssembler::AssertIsRoot(Register reg, Heap::RootListIndex index) { if (emit_debug_code()) { ASSERT(!reg.is(at)); diff --git a/src/mips/macro-assembler-mips.h b/src/mips/macro-assembler-mips.h index c22056f..f484a28 100644 --- a/src/mips/macro-assembler-mips.h +++ b/src/mips/macro-assembler-mips.h @@ -1432,6 +1432,10 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT // Abort execution if argument is not a name, enabled via --debug-code. void AssertName(Register object); + // Abort execution if argument is not undefined or an AllocationSite, enabled + // via --debug-code. + void AssertUndefinedOrAllocationSite(Register object, Register scratch); + // Abort execution if reg is not the root value with the given index, // enabled via --debug-code. void AssertIsRoot(Register reg, Heap::RootListIndex index);