Commit 1a033e5d authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: Refactor Map::ConstructionCount.

Port 35ff259b

Original commit message:
This combines Map::DoneInobjectSlackTracking and Map::ConstructionCount into one more generic 4-bit counter.

Counter values from 15 down to 8 are used for in-object slack tracking, values from 7 down to 0 are free to be used for a new counter when in-object slack tracking is inactive

BUG=

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

Cr-Commit-Position: refs/heads/master@{#25692}
parent cd0a53bc
...@@ -382,21 +382,21 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, ...@@ -382,21 +382,21 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
MemOperand bit_field3 = FieldMemOperand(a2, Map::kBitField3Offset); MemOperand bit_field3 = FieldMemOperand(a2, Map::kBitField3Offset);
// Check if slack tracking is enabled. // Check if slack tracking is enabled.
__ lw(t0, bit_field3); __ lw(t0, bit_field3);
__ DecodeField<Map::ConstructionCount>(t2, t0); __ DecodeField<Map::Counter>(t2, t0);
__ Branch(&allocate, eq, t2, Operand(JSFunction::kNoSlackTracking)); __ Branch(&allocate, lt, t2, Operand(Map::kSlackTrackingCounterEnd));
// Decrease generous allocation count. // Decrease generous allocation count.
__ Subu(t0, t0, Operand(1 << Map::ConstructionCount::kShift)); __ Subu(t0, t0, Operand(1 << Map::Counter::kShift));
__ Branch(USE_DELAY_SLOT, __ Branch(USE_DELAY_SLOT, &allocate, ne, t2,
&allocate, ne, t2, Operand(JSFunction::kFinishSlackTracking)); Operand(Map::kSlackTrackingCounterEnd));
__ sw(t0, bit_field3); // In delay slot. __ sw(t0, bit_field3); // In delay slot.
__ Push(a1, a2, a1); // a1 = Constructor. __ Push(a1, a2, a1); // a1 = Constructor.
__ CallRuntime(Runtime::kFinalizeInstanceSize, 1); __ CallRuntime(Runtime::kFinalizeInstanceSize, 1);
__ Pop(a1, a2); __ Pop(a1, a2);
// Slack tracking counter is kNoSlackTracking after runtime call. // Slack tracking counter is Map::kSlackTrackingCounterEnd after runtime
DCHECK(JSFunction::kNoSlackTracking == 0); // call.
__ mov(t2, zero_reg); __ li(t2, Map::kSlackTrackingCounterEnd);
__ bind(&allocate); __ bind(&allocate);
} }
...@@ -443,8 +443,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, ...@@ -443,8 +443,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
Label no_inobject_slack_tracking; Label no_inobject_slack_tracking;
// Check if slack tracking is enabled. // Check if slack tracking is enabled.
__ Branch(&no_inobject_slack_tracking, __ Branch(&no_inobject_slack_tracking, lt, t2,
eq, t2, Operand(JSFunction::kNoSlackTracking)); Operand(Map::kSlackTrackingCounterEnd));
// Allocate object with a slack. // Allocate object with a slack.
__ lbu(a0, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset)); __ lbu(a0, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset));
......
...@@ -382,15 +382,13 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, ...@@ -382,15 +382,13 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
MemOperand bit_field3 = FieldMemOperand(a2, Map::kBitField3Offset); MemOperand bit_field3 = FieldMemOperand(a2, Map::kBitField3Offset);
// Check if slack tracking is enabled. // Check if slack tracking is enabled.
__ lwu(a4, bit_field3); __ lwu(a4, bit_field3);
__ DecodeField<Map::ConstructionCount>(a6, a4); __ DecodeField<Map::Counter>(a6, a4);
__ Branch(&allocate, __ Branch(&allocate, lt, a6,
eq, Operand(static_cast<int64_t>(Map::kSlackTrackingCounterEnd)));
a6,
Operand(static_cast<int64_t>(JSFunction::kNoSlackTracking)));
// Decrease generous allocation count. // Decrease generous allocation count.
__ Dsubu(a4, a4, Operand(1 << Map::ConstructionCount::kShift)); __ Dsubu(a4, a4, Operand(1 << Map::Counter::kShift));
__ Branch(USE_DELAY_SLOT, __ Branch(USE_DELAY_SLOT, &allocate, ne, a6,
&allocate, ne, a6, Operand(JSFunction::kFinishSlackTracking)); Operand(Map::kSlackTrackingCounterEnd));
__ sw(a4, bit_field3); // In delay slot. __ sw(a4, bit_field3); // In delay slot.
__ Push(a1, a2, a1); // a1 = Constructor. __ Push(a1, a2, a1); // a1 = Constructor.
...@@ -446,10 +444,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, ...@@ -446,10 +444,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
Label no_inobject_slack_tracking; Label no_inobject_slack_tracking;
// Check if slack tracking is enabled. // Check if slack tracking is enabled.
__ Branch(&no_inobject_slack_tracking, __ Branch(&no_inobject_slack_tracking, lt, a6,
eq, Operand(static_cast<int64_t>(Map::kSlackTrackingCounterEnd)));
a6,
Operand(static_cast<int64_t>(JSFunction::kNoSlackTracking)));
// Allocate object with a slack. // Allocate object with a slack.
__ lwu(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset)); __ lwu(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset));
......
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