Commit ddcb9b6d authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: Use weak cells to embed maps in store handler.

Port 3fc9c9b6

BUG=v8:3629
LOG=N

Review URL: https://codereview.chromium.org/762483004

Cr-Commit-Position: refs/heads/master@{#25647}
parent 9143a224
...@@ -321,10 +321,23 @@ void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, ...@@ -321,10 +321,23 @@ void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label,
} }
void NamedStoreHandlerCompiler::GenerateRestoreNameAndMap( void NamedStoreHandlerCompiler::GenerateRestoreName(Handle<Name> name) {
Handle<Name> name, Handle<Map> transition) {
__ li(this->name(), Operand(name)); __ li(this->name(), Operand(name));
__ li(StoreTransitionDescriptor::MapRegister(), Operand(transition)); }
void NamedStoreHandlerCompiler::GenerateRestoreMap(Handle<Map> transition,
Register scratch,
Label* miss) {
Handle<WeakCell> cell = Map::WeakCellForMap(transition);
Register map_reg = StoreTransitionDescriptor::MapRegister();
DCHECK(!map_reg.is(scratch));
__ LoadWeakValue(map_reg, cell, miss);
if (transition->CanBeDeprecated()) {
__ lw(scratch, FieldMemOperand(map_reg, Map::kBitField3Offset));
__ And(at, scratch, Operand(Map::Deprecated::kMask));
__ Branch(miss, ne, at, Operand(zero_reg));
}
} }
......
...@@ -321,10 +321,23 @@ void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, ...@@ -321,10 +321,23 @@ void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label,
} }
void NamedStoreHandlerCompiler::GenerateRestoreNameAndMap( void NamedStoreHandlerCompiler::GenerateRestoreName(Handle<Name> name) {
Handle<Name> name, Handle<Map> transition) {
__ li(this->name(), Operand(name)); __ li(this->name(), Operand(name));
__ li(StoreTransitionDescriptor::MapRegister(), Operand(transition)); }
void NamedStoreHandlerCompiler::GenerateRestoreMap(Handle<Map> transition,
Register scratch,
Label* miss) {
Handle<WeakCell> cell = Map::WeakCellForMap(transition);
Register map_reg = StoreTransitionDescriptor::MapRegister();
DCHECK(!map_reg.is(scratch));
__ LoadWeakValue(map_reg, cell, miss);
if (transition->CanBeDeprecated()) {
__ ld(scratch, FieldMemOperand(map_reg, Map::kBitField3Offset));
__ And(at, scratch, Operand(Map::Deprecated::kMask));
__ Branch(miss, ne, at, Operand(zero_reg));
}
} }
......
...@@ -5808,18 +5808,6 @@ void MacroAssembler::CheckPageFlag( ...@@ -5808,18 +5808,6 @@ void MacroAssembler::CheckPageFlag(
} }
void MacroAssembler::CheckMapDeprecated(Handle<Map> map,
Register scratch,
Label* if_deprecated) {
if (map->CanBeDeprecated()) {
li(scratch, Operand(map));
lw(scratch, FieldMemOperand(scratch, Map::kBitField3Offset));
And(scratch, scratch, Operand(Map::Deprecated::kMask));
Branch(if_deprecated, ne, scratch, Operand(zero_reg));
}
}
void MacroAssembler::JumpIfBlack(Register object, void MacroAssembler::JumpIfBlack(Register object,
Register scratch0, Register scratch0,
Register scratch1, Register scratch1,
......
...@@ -315,10 +315,6 @@ class MacroAssembler: public Assembler { ...@@ -315,10 +315,6 @@ class MacroAssembler: public Assembler {
Condition cc, Condition cc,
Label* condition_met); Label* condition_met);
void CheckMapDeprecated(Handle<Map> map,
Register scratch,
Label* if_deprecated);
// Check if object is in new space. Jumps if the object is not in new space. // Check if object is in new space. Jumps if the object is not in new space.
// The register scratch can be object itself, but it will be clobbered. // The register scratch can be object itself, but it will be clobbered.
void JumpIfNotInNewSpace(Register object, void JumpIfNotInNewSpace(Register object,
......
...@@ -5853,18 +5853,6 @@ void MacroAssembler::CheckPageFlag( ...@@ -5853,18 +5853,6 @@ void MacroAssembler::CheckPageFlag(
} }
void MacroAssembler::CheckMapDeprecated(Handle<Map> map,
Register scratch,
Label* if_deprecated) {
if (map->CanBeDeprecated()) {
li(scratch, Operand(map));
ld(scratch, FieldMemOperand(scratch, Map::kBitField3Offset));
And(scratch, scratch, Operand(Map::Deprecated::kMask));
Branch(if_deprecated, ne, scratch, Operand(zero_reg));
}
}
void MacroAssembler::JumpIfBlack(Register object, void MacroAssembler::JumpIfBlack(Register object,
Register scratch0, Register scratch0,
Register scratch1, Register scratch1,
......
...@@ -336,10 +336,6 @@ class MacroAssembler: public Assembler { ...@@ -336,10 +336,6 @@ class MacroAssembler: public Assembler {
Condition cc, Condition cc,
Label* condition_met); Label* condition_met);
void CheckMapDeprecated(Handle<Map> map,
Register scratch,
Label* if_deprecated);
// Check if object is in new space. Jumps if the object is not in new space. // Check if object is in new space. Jumps if the object is not in new space.
// The register scratch can be object itself, but it will be clobbered. // The register scratch can be object itself, but it will be clobbered.
void JumpIfNotInNewSpace(Register object, void JumpIfNotInNewSpace(Register object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment