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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 // Fill all the in-object properties with the appropriate filler. | 193 // Fill all the in-object properties with the appropriate filler. |
194 // ebx: JSObject (tagged) | 194 // ebx: JSObject (tagged) |
195 // ecx: First in-object property of JSObject (not tagged) | 195 // ecx: First in-object property of JSObject (not tagged) |
196 __ mov(edx, factory->undefined_value()); | 196 __ mov(edx, factory->undefined_value()); |
197 | 197 |
198 if (!is_api_function) { | 198 if (!is_api_function) { |
199 Label no_inobject_slack_tracking; | 199 Label no_inobject_slack_tracking; |
200 | 200 |
201 // The code below relies on these assumptions. | 201 // The code below relies on these assumptions. |
202 STATIC_ASSERT(Map::Counter::kShift + Map::Counter::kSize == 32); | 202 STATIC_ASSERT(Map::kNoSlackTracking == 0); |
| 203 STATIC_ASSERT(Map::ConstructionCounter::kNext == 32); |
203 // Check if slack tracking is enabled. | 204 // Check if slack tracking is enabled. |
204 __ mov(esi, FieldOperand(eax, Map::kBitField3Offset)); | 205 __ mov(esi, FieldOperand(eax, Map::kBitField3Offset)); |
205 __ shr(esi, Map::Counter::kShift); | 206 __ shr(esi, Map::ConstructionCounter::kShift); |
206 __ cmp(esi, Map::kSlackTrackingCounterEnd); | 207 __ j(zero, &no_inobject_slack_tracking); // Map::kNoSlackTracking |
207 __ j(less, &no_inobject_slack_tracking); | |
208 __ push(esi); // Save allocation count value. | 208 __ push(esi); // Save allocation count value. |
209 // Decrease generous allocation count. | 209 // Decrease generous allocation count. |
210 __ sub(FieldOperand(eax, Map::kBitField3Offset), | 210 __ sub(FieldOperand(eax, Map::kBitField3Offset), |
211 Immediate(1 << Map::Counter::kShift)); | 211 Immediate(1 << Map::ConstructionCounter::kShift)); |
212 | 212 |
213 // Allocate object with a slack. | 213 // Allocate object with a slack. |
214 __ movzx_b(esi, FieldOperand(eax, Map::kUnusedPropertyFieldsOffset)); | 214 __ movzx_b(esi, FieldOperand(eax, Map::kUnusedPropertyFieldsOffset)); |
215 __ neg(esi); | 215 __ neg(esi); |
216 __ lea(esi, Operand(edi, esi, times_pointer_size, 0)); | 216 __ lea(esi, Operand(edi, esi, times_pointer_size, 0)); |
217 // esi: offset of first field after pre-allocated fields | 217 // esi: offset of first field after pre-allocated fields |
218 if (FLAG_debug_code) { | 218 if (FLAG_debug_code) { |
219 __ cmp(ecx, esi); | 219 __ cmp(ecx, esi); |
220 __ Assert(less_equal, | 220 __ Assert(less_equal, |
221 kUnexpectedNumberOfPreAllocatedPropertyFields); | 221 kUnexpectedNumberOfPreAllocatedPropertyFields); |
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 | 1958 |
1959 __ bind(&ok); | 1959 __ bind(&ok); |
1960 __ ret(0); | 1960 __ ret(0); |
1961 } | 1961 } |
1962 | 1962 |
1963 #undef __ | 1963 #undef __ |
1964 } // namespace internal | 1964 } // namespace internal |
1965 } // namespace v8 | 1965 } // namespace v8 |
1966 | 1966 |
1967 #endif // V8_TARGET_ARCH_X87 | 1967 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |