Revision: 8176
Author: [email protected]
Date: Mon Jun 6 01:49:15 2011
Log: MIPS: port Add complete ElementsKind information directly to Map
for objects with elements.
Ported commits: r8162 (c56f802)
BUG=
TEST=
Review URL: http://codereview.chromium.org/7024042
Patch from Paul Lind <[email protected]>.
http://code.google.com/p/v8/source/detail?r=8176
Modified:
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
/branches/bleeding_edge/src/mips/ic-mips.cc
/branches/bleeding_edge/src/mips/macro-assembler-mips.cc
/branches/bleeding_edge/src/mips/macro-assembler-mips.h
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Jun 6
01:47:27 2011
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Jun 6
01:49:15 2011
@@ -3446,9 +3446,7 @@
__ Branch(&bailout, ne, scratch2, Operand(JS_ARRAY_TYPE));
// Check that the array has fast elements.
- __ lbu(scratch2, FieldMemOperand(scratch1, Map::kBitField2Offset));
- __ And(scratch3, scratch2, Operand(1 << Map::kHasFastElements));
- __ Branch(&bailout, eq, scratch3, Operand(zero_reg));
+ __ CheckFastElements(scratch1, scratch2, &bailout);
// If the array has length zero, return the empty string.
__ lw(array_length, FieldMemOperand(array, JSArray::kLengthOffset));
=======================================
--- /branches/bleeding_edge/src/mips/ic-mips.cc Mon Jun 6 01:47:27 2011
+++ /branches/bleeding_edge/src/mips/ic-mips.cc Mon Jun 6 01:49:15 2011
@@ -950,11 +950,8 @@
GenerateKeyedLoadReceiverCheck(
masm, receiver, a2, a3, Map::kHasIndexedInterceptor, &slow);
- // Check the "has fast elements" bit in the receiver's map which is
- // now in a2.
- __ lbu(a3, FieldMemOperand(a2, Map::kBitField2Offset));
- __ And(at, a3, Operand(1 << Map::kHasFastElements));
- __ Branch(&check_number_dictionary, eq, at, Operand(zero_reg));
+ // Check the receiver's map to see if it has fast elements.
+ __ CheckFastElements(a2, a3, &check_number_dictionary);
GenerateFastArrayLoad(
masm, receiver, key, t0, a3, a2, v0, NULL, &slow);
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Mon Jun 6
01:47:27 2011
+++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Mon Jun 6
01:49:15 2011
@@ -2645,6 +2645,16 @@
Branch(&byte_loop_1, ne, length, Operand(zero_reg));
bind(&done);
}
+
+
+void MacroAssembler::CheckFastElements(Register map,
+ Register scratch,
+ Label* fail) {
+ STATIC_ASSERT(JSObject::FAST_ELEMENTS == 0);
+ lbu(scratch, FieldMemOperand(map, Map::kBitField2Offset));
+ And(scratch, scratch, Operand(Map::kMaximumBitField2FastElementValue));
+ Branch(fail, hi, scratch, Operand(zero_reg));
+}
void MacroAssembler::CheckMap(Register obj,
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.h Wed Jun 1
02:01:57 2011
+++ /branches/bleeding_edge/src/mips/macro-assembler-mips.h Mon Jun 6
01:49:15 2011
@@ -723,6 +723,12 @@
Register map,
Register type_reg);
+ // Check if a map for a JSObject indicates that the object has fast
elements.
+ // Jump to the specified label if it does not.
+ void CheckFastElements(Register map,
+ Register scratch,
+ Label* fail);
+
// Check if the map of an object is equal to a specified map (either
// given directly or as an index into the root list) and branch to
// label if not. Skip the smi check if not required (object is known
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev