MIPS: Swap bitfield3 and backpointer.
Port r12034 (f17b84c0) Original commit message: Bitfield3 now has its own field, while the backpointer shares the field with the descriptor array; which will become the transition array. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10692192 Patch from Akos Palfi <palfia@homejinni.com>. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12075 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
ed371d4881
commit
e875306037
@ -1148,7 +1148,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We got a map in register v0. Get the enumeration cache from it.
|
||||
__ bind(&use_cache);
|
||||
__ LoadInstanceDescriptors(v0, a1);
|
||||
__ LoadInstanceDescriptors(v0, a1, a2);
|
||||
__ lw(a1, FieldMemOperand(a1, DescriptorArray::kEnumerationIndexOffset));
|
||||
__ lw(a2, FieldMemOperand(a1, DescriptorArray::kEnumCacheBridgeCacheOffset));
|
||||
|
||||
@ -2759,7 +2759,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
|
||||
// Look for valueOf symbol in the descriptor array, and indicate false if
|
||||
// found. The type is not checked, so if it is a transition it is a false
|
||||
// negative.
|
||||
__ LoadInstanceDescriptors(a1, t0);
|
||||
__ LoadInstanceDescriptors(a1, t0, a3);
|
||||
__ lw(a3, FieldMemOperand(t0, FixedArray::kLengthOffset));
|
||||
// t0: descriptor array
|
||||
// a3: length of descriptor array
|
||||
|
@ -5165,7 +5165,8 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
|
||||
void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
|
||||
Register map = ToRegister(instr->map());
|
||||
Register result = ToRegister(instr->result());
|
||||
__ LoadInstanceDescriptors(map, result);
|
||||
Register scratch = ToRegister(instr->scratch());
|
||||
__ LoadInstanceDescriptors(map, result, scratch);
|
||||
__ lw(result,
|
||||
FieldMemOperand(result, DescriptorArray::kEnumerationIndexOffset));
|
||||
__ lw(result,
|
||||
|
@ -2200,8 +2200,9 @@ LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) {
|
||||
|
||||
LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) {
|
||||
LOperand* map = UseRegister(instr->map());
|
||||
LOperand* scratch = TempRegister();
|
||||
return AssignEnvironment(DefineAsRegister(
|
||||
new(zone()) LForInCacheArray(map)));
|
||||
new(zone()) LForInCacheArray(map, scratch)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2143,13 +2143,15 @@ class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
|
||||
};
|
||||
|
||||
|
||||
class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
|
||||
class LForInCacheArray: public LTemplateInstruction<1, 1, 1> {
|
||||
public:
|
||||
explicit LForInCacheArray(LOperand* map) {
|
||||
explicit LForInCacheArray(LOperand* map, LOperand* scratch) {
|
||||
inputs_[0] = map;
|
||||
temps_[0] = scratch;
|
||||
}
|
||||
|
||||
LOperand* map() { return inputs_[0]; }
|
||||
LOperand* scratch() { return temps_[0]; }
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
|
||||
|
||||
|
@ -5290,13 +5290,21 @@ void MacroAssembler::EnsureNotWhite(
|
||||
|
||||
|
||||
void MacroAssembler::LoadInstanceDescriptors(Register map,
|
||||
Register descriptors) {
|
||||
Register descriptors,
|
||||
Register scratch) {
|
||||
lw(descriptors,
|
||||
FieldMemOperand(map, Map::kInstanceDescriptorsOrBitField3Offset));
|
||||
Label not_smi;
|
||||
JumpIfNotSmi(descriptors, ¬_smi);
|
||||
FieldMemOperand(map, Map::kInstanceDescriptorsOrBackPointerOffset));
|
||||
|
||||
Label ok, fail;
|
||||
CheckMap(descriptors,
|
||||
scratch,
|
||||
isolate()->factory()->fixed_array_map(),
|
||||
&fail,
|
||||
DONT_DO_SMI_CHECK);
|
||||
jmp(&ok);
|
||||
bind(&fail);
|
||||
LoadRoot(descriptors, Heap::kEmptyDescriptorArrayRootIndex);
|
||||
bind(¬_smi);
|
||||
bind(&ok);
|
||||
}
|
||||
|
||||
|
||||
@ -5320,8 +5328,13 @@ void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
|
||||
// check for an enum cache. Leave the map in a2 for the subsequent
|
||||
// prototype load.
|
||||
lw(a2, FieldMemOperand(a1, HeapObject::kMapOffset));
|
||||
lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOrBitField3Offset));
|
||||
JumpIfSmi(a3, call_runtime);
|
||||
lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOrBackPointerOffset));
|
||||
|
||||
CheckMap(a3,
|
||||
t3,
|
||||
isolate()->factory()->fixed_array_map(),
|
||||
call_runtime,
|
||||
DONT_DO_SMI_CHECK);
|
||||
|
||||
// Check that there is an enum cache in the non-empty instance
|
||||
// descriptors (a3). This is the case if the next enumeration
|
||||
|
@ -1396,7 +1396,9 @@ class MacroAssembler: public Assembler {
|
||||
DoubleRegister temp_double_reg);
|
||||
|
||||
|
||||
void LoadInstanceDescriptors(Register map, Register descriptors);
|
||||
void LoadInstanceDescriptors(Register map,
|
||||
Register descriptors,
|
||||
Register scratch);
|
||||
|
||||
|
||||
// Activation support.
|
||||
|
Loading…
Reference in New Issue
Block a user