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

Side by Side Diff: src/x64/builtins-x64.cc

Issue 1506683004: Free one bit in Map by removing unused retaining counter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | src/x87/builtins-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 // Fill all the in-object properties with the appropriate filler. 179 // Fill all the in-object properties with the appropriate filler.
180 // rbx: JSObject (tagged) 180 // rbx: JSObject (tagged)
181 // rcx: First in-object property of JSObject (not tagged) 181 // rcx: First in-object property of JSObject (not tagged)
182 __ LoadRoot(r11, Heap::kUndefinedValueRootIndex); 182 __ LoadRoot(r11, Heap::kUndefinedValueRootIndex);
183 183
184 if (!is_api_function) { 184 if (!is_api_function) {
185 Label no_inobject_slack_tracking; 185 Label no_inobject_slack_tracking;
186 186
187 // The code below relies on these assumptions. 187 // The code below relies on these assumptions.
188 STATIC_ASSERT(Map::Counter::kShift + Map::Counter::kSize == 32); 188 STATIC_ASSERT(Map::kNoSlackTracking == 0);
189 STATIC_ASSERT(Map::ConstructionCounter::kNext == 32);
189 // Check if slack tracking is enabled. 190 // Check if slack tracking is enabled.
190 __ movl(rsi, FieldOperand(rax, Map::kBitField3Offset)); 191 __ movl(rsi, FieldOperand(rax, Map::kBitField3Offset));
191 __ shrl(rsi, Immediate(Map::Counter::kShift)); 192 __ shrl(rsi, Immediate(Map::ConstructionCounter::kShift));
192 __ cmpl(rsi, Immediate(Map::kSlackTrackingCounterEnd)); 193 __ j(zero, &no_inobject_slack_tracking); // Map::kNoSlackTracking
193 __ j(less, &no_inobject_slack_tracking);
194 __ Push(rsi); // Save allocation count value. 194 __ Push(rsi); // Save allocation count value.
195 // Decrease generous allocation count. 195 // Decrease generous allocation count.
196 __ subl(FieldOperand(rax, Map::kBitField3Offset), 196 __ subl(FieldOperand(rax, Map::kBitField3Offset),
197 Immediate(1 << Map::Counter::kShift)); 197 Immediate(1 << Map::ConstructionCounter::kShift));
198 198
199 // Allocate object with a slack. 199 // Allocate object with a slack.
200 __ movzxbp(rsi, FieldOperand(rax, Map::kUnusedPropertyFieldsOffset)); 200 __ movzxbp(rsi, FieldOperand(rax, Map::kUnusedPropertyFieldsOffset));
201 __ negp(rsi); 201 __ negp(rsi);
202 __ leap(rsi, Operand(r9, rsi, times_pointer_size, 0)); 202 __ leap(rsi, Operand(r9, rsi, times_pointer_size, 0));
203 // rsi: offset of first field after pre-allocated fields 203 // rsi: offset of first field after pre-allocated fields
204 if (FLAG_debug_code) { 204 if (FLAG_debug_code) {
205 __ cmpp(rcx, rsi); 205 __ cmpp(rcx, rsi);
206 __ Assert(less_equal, 206 __ Assert(less_equal,
207 kUnexpectedNumberOfPreAllocatedPropertyFields); 207 kUnexpectedNumberOfPreAllocatedPropertyFields);
(...skipping 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 __ ret(0); 2034 __ ret(0);
2035 } 2035 }
2036 2036
2037 2037
2038 #undef __ 2038 #undef __
2039 2039
2040 } // namespace internal 2040 } // namespace internal
2041 } // namespace v8 2041 } // namespace v8
2042 2042
2043 #endif // V8_TARGET_ARCH_X64 2043 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | src/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698