Reviewers: danno, mvstanton, Paul Lind, palfia, kisg, dusmil,
Description:
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=
Please review this at https://codereview.chromium.org/196423018/
SVN Base: https://github.com/v8/v8.git@gbl
Affected files (+21, -0 lines):
M src/mips/macro-assembler-mips.h
M src/mips/macro-assembler-mips.cc
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc
b/src/mips/macro-assembler-mips.cc
index
0538cd4077d10f473009d2102d57b05b2ccf94a8..279eba314911ad49f92c63ffde651354496896a1
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));
Index: src/mips/macro-assembler-mips.h
diff --git a/src/mips/macro-assembler-mips.h
b/src/mips/macro-assembler-mips.h
index
c22056fb794699108d9adf6c20cb34aca6297dcb..f484a288c94e4f8c4f3becbbee662810b53f4a31
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);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.