Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: src/x64/builtins-x64.cc

Issue 767253002: Refactor Map::ConstructionCount. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix assert Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/x87/builtins-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index 64ba35115b5c61ffd59d4c727a31203a0f528db0..ef3df659eb7a94d9801d4687f311000a02f9af40 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -158,22 +158,20 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// rax: initial map
__ CmpInstanceType(rax, JS_FUNCTION_TYPE);
__ j(equal, &rt_call);
-
if (!is_api_function) {
Label allocate;
// The code below relies on these assumptions.
- STATIC_ASSERT(JSFunction::kNoSlackTracking == 0);
- STATIC_ASSERT(Map::ConstructionCount::kShift +
- Map::ConstructionCount::kSize == 32);
+ STATIC_ASSERT(Map::Counter::kShift + Map::Counter::kSize == 32);
// Check if slack tracking is enabled.
__ movl(rsi, FieldOperand(rax, Map::kBitField3Offset));
- __ shrl(rsi, Immediate(Map::ConstructionCount::kShift));
- __ j(zero, &allocate); // JSFunction::kNoSlackTracking
+ __ shrl(rsi, Immediate(Map::Counter::kShift));
+ __ cmpl(rsi, Immediate(Map::kSlackTrackingCounterEnd));
+ __ j(less, &allocate);
// Decrease generous allocation count.
__ subl(FieldOperand(rax, Map::kBitField3Offset),
- Immediate(1 << Map::ConstructionCount::kShift));
+ Immediate(1 << Map::Counter::kShift));
- __ cmpl(rsi, Immediate(JSFunction::kFinishSlackTracking));
+ __ cmpl(rsi, Immediate(Map::kSlackTrackingCounterEnd));
__ j(not_equal, &allocate);
__ Push(rax);
@@ -184,7 +182,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ Pop(rdi);
__ Pop(rax);
- __ xorl(rsi, rsi); // JSFunction::kNoSlackTracking
+ __ movl(rsi, Immediate(Map::kSlackTrackingCounterEnd - 1));
__ bind(&allocate);
}
@@ -222,8 +220,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
Label no_inobject_slack_tracking;
// Check if slack tracking is enabled.
- __ cmpl(rsi, Immediate(JSFunction::kNoSlackTracking));
- __ j(equal, &no_inobject_slack_tracking);
+ __ cmpl(rsi, Immediate(Map::kSlackTrackingCounterEnd));
+ __ j(less, &no_inobject_slack_tracking);
// Allocate object with a slack.
__ movzxbp(rsi,
« no previous file with comments | « src/objects-inl.h ('k') | src/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698