| 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 // See comment on JSObject::InitializeBody() for details. |
| 230 rsi, | 230 __ movzxbp(rsi, FieldOperand(rax, Map::kUnusedPropertyFieldsOffset)); |
| 231 FieldOperand( | 231 __ negp(rsi); |
| 232 rax, | 232 __ leap(rsi, Operand(rdi, rsi, times_pointer_size, 0)); |
| 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 | 233 // rsi: offset of first field after pre-allocated fields |
| 239 if (FLAG_debug_code) { | 234 if (FLAG_debug_code) { |
| 240 __ cmpp(rsi, rdi); | 235 __ cmpp(rcx, rsi); |
| 241 __ Assert(less_equal, | 236 __ Assert(less_equal, |
| 242 kUnexpectedNumberOfPreAllocatedPropertyFields); | 237 kUnexpectedNumberOfPreAllocatedPropertyFields); |
| 243 } | 238 } |
| 244 __ InitializeFieldsWithFiller(rcx, rsi, rdx); | 239 __ InitializeFieldsWithFiller(rcx, rsi, rdx); |
| 245 __ LoadRoot(rdx, Heap::kOnePointerFillerMapRootIndex); | 240 __ LoadRoot(rdx, Heap::kOnePointerFillerMapRootIndex); |
| 246 // Fill the remaining fields with one pointer filler map. | 241 // Fill the remaining fields with one pointer filler map. |
| 247 | 242 |
| 248 __ bind(&no_inobject_slack_tracking); | 243 __ bind(&no_inobject_slack_tracking); |
| 249 } | 244 } |
| 250 | 245 |
| (...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 __ ret(0); | 1908 __ ret(0); |
| 1914 } | 1909 } |
| 1915 | 1910 |
| 1916 | 1911 |
| 1917 #undef __ | 1912 #undef __ |
| 1918 | 1913 |
| 1919 } // namespace internal | 1914 } // namespace internal |
| 1920 } // namespace v8 | 1915 } // namespace v8 |
| 1921 | 1916 |
| 1922 #endif // V8_TARGET_ARCH_X64 | 1917 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |