OLD | NEW |
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 __ leap(rcx, Operand(rbx, JSObject::kHeaderSize)); | 219 __ leap(rcx, Operand(rbx, JSObject::kHeaderSize)); |
220 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); | 220 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); |
221 if (!is_api_function) { | 221 if (!is_api_function) { |
222 Label no_inobject_slack_tracking; | 222 Label no_inobject_slack_tracking; |
223 | 223 |
224 // Check if slack tracking is enabled. | 224 // Check if slack tracking is enabled. |
225 __ cmpl(rsi, Immediate(Map::kSlackTrackingCounterEnd)); | 225 __ cmpl(rsi, Immediate(Map::kSlackTrackingCounterEnd)); |
226 __ j(less, &no_inobject_slack_tracking); | 226 __ j(less, &no_inobject_slack_tracking); |
227 | 227 |
228 // Allocate object with a slack. | 228 // Allocate object with a slack. |
229 __ movzxbp( | 229 __ movzxbp(rsi, FieldOperand(rax, Map::kUnusedPropertyFieldsOffset)); |
230 rsi, | 230 __ negp(rsi); |
231 FieldOperand( | 231 __ leap(rsi, Operand(rdi, rsi, times_pointer_size, 0)); |
232 rax, | |
233 Map::kInObjectPropertiesOrConstructorFunctionIndexOffset)); | |
234 __ movzxbp(rax, FieldOperand(rax, Map::kUnusedPropertyFieldsOffset)); | |
235 __ subp(rsi, rax); | |
236 __ leap(rsi, | |
237 Operand(rbx, rsi, times_pointer_size, JSObject::kHeaderSize)); | |
238 // rsi: offset of first field after pre-allocated fields | 232 // rsi: offset of first field after pre-allocated fields |
239 if (FLAG_debug_code) { | 233 if (FLAG_debug_code) { |
240 __ cmpp(rsi, rdi); | 234 __ cmpp(rcx, rsi); |
241 __ Assert(less_equal, | 235 __ Assert(less_equal, |
242 kUnexpectedNumberOfPreAllocatedPropertyFields); | 236 kUnexpectedNumberOfPreAllocatedPropertyFields); |
243 } | 237 } |
244 __ InitializeFieldsWithFiller(rcx, rsi, rdx); | 238 __ InitializeFieldsWithFiller(rcx, rsi, rdx); |
245 __ LoadRoot(rdx, Heap::kOnePointerFillerMapRootIndex); | 239 __ LoadRoot(rdx, Heap::kOnePointerFillerMapRootIndex); |
246 // Fill the remaining fields with one pointer filler map. | 240 // Fill the remaining fields with one pointer filler map. |
247 | 241 |
248 __ bind(&no_inobject_slack_tracking); | 242 __ bind(&no_inobject_slack_tracking); |
249 } | 243 } |
250 | 244 |
(...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1913 __ ret(0); | 1907 __ ret(0); |
1914 } | 1908 } |
1915 | 1909 |
1916 | 1910 |
1917 #undef __ | 1911 #undef __ |
1918 | 1912 |
1919 } // namespace internal | 1913 } // namespace internal |
1920 } // namespace v8 | 1914 } // namespace v8 |
1921 | 1915 |
1922 #endif // V8_TARGET_ARCH_X64 | 1916 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |