| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
| 6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
| 7 | 7 |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/contexts.h" | 9 #include "src/contexts.h" |
| 10 #include "src/elements.h" | 10 #include "src/elements.h" |
| (...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2240 elements, index, MachineType::Float64(), 0, | 2240 elements, index, MachineType::Float64(), 0, |
| 2241 CodeStubAssembler::SMI_PARAMETERS); | 2241 CodeStubAssembler::SMI_PARAMETERS); |
| 2242 var_value.Bind(assembler->AllocateHeapNumberWithValue(value)); | 2242 var_value.Bind(assembler->AllocateHeapNumberWithValue(value)); |
| 2243 assembler->Goto(&allocate_entry_if_needed); | 2243 assembler->Goto(&allocate_entry_if_needed); |
| 2244 } | 2244 } |
| 2245 | 2245 |
| 2246 assembler->Bind(&holey_object_values); | 2246 assembler->Bind(&holey_object_values); |
| 2247 { | 2247 { |
| 2248 // Check the array_protector cell, and take the slow path if it's invalid. | 2248 // Check the array_protector cell, and take the slow path if it's invalid. |
| 2249 Node* invalid = | 2249 Node* invalid = |
| 2250 assembler->SmiConstant(Smi::FromInt(Isolate::kArrayProtectorInvalid)); | 2250 assembler->SmiConstant(Smi::FromInt(Isolate::kProtectorInvalid)); |
| 2251 Node* cell = assembler->LoadRoot(Heap::kArrayProtectorRootIndex); | 2251 Node* cell = assembler->LoadRoot(Heap::kArrayProtectorRootIndex); |
| 2252 Node* cell_value = | 2252 Node* cell_value = |
| 2253 assembler->LoadObjectField(cell, PropertyCell::kValueOffset); | 2253 assembler->LoadObjectField(cell, PropertyCell::kValueOffset); |
| 2254 assembler->GotoIf(assembler->WordEqual(cell_value, invalid), | 2254 assembler->GotoIf(assembler->WordEqual(cell_value, invalid), |
| 2255 &generic_values); | 2255 &generic_values); |
| 2256 | 2256 |
| 2257 var_value.Bind(assembler->UndefinedConstant()); | 2257 var_value.Bind(assembler->UndefinedConstant()); |
| 2258 Node* value = assembler->LoadFixedArrayElement( | 2258 Node* value = assembler->LoadFixedArrayElement( |
| 2259 elements, index, 0, CodeStubAssembler::SMI_PARAMETERS); | 2259 elements, index, 0, CodeStubAssembler::SMI_PARAMETERS); |
| 2260 assembler->GotoIf( | 2260 assembler->GotoIf( |
| 2261 assembler->WordEqual(value, assembler->TheHoleConstant()), | 2261 assembler->WordEqual(value, assembler->TheHoleConstant()), |
| 2262 &allocate_entry_if_needed); | 2262 &allocate_entry_if_needed); |
| 2263 var_value.Bind(value); | 2263 var_value.Bind(value); |
| 2264 assembler->Goto(&allocate_entry_if_needed); | 2264 assembler->Goto(&allocate_entry_if_needed); |
| 2265 } | 2265 } |
| 2266 | 2266 |
| 2267 assembler->Bind(&holey_double_values); | 2267 assembler->Bind(&holey_double_values); |
| 2268 { | 2268 { |
| 2269 // Check the array_protector cell, and take the slow path if it's invalid. | 2269 // Check the array_protector cell, and take the slow path if it's invalid. |
| 2270 Node* invalid = | 2270 Node* invalid = |
| 2271 assembler->SmiConstant(Smi::FromInt(Isolate::kArrayProtectorInvalid)); | 2271 assembler->SmiConstant(Smi::FromInt(Isolate::kProtectorInvalid)); |
| 2272 Node* cell = assembler->LoadRoot(Heap::kArrayProtectorRootIndex); | 2272 Node* cell = assembler->LoadRoot(Heap::kArrayProtectorRootIndex); |
| 2273 Node* cell_value = | 2273 Node* cell_value = |
| 2274 assembler->LoadObjectField(cell, PropertyCell::kValueOffset); | 2274 assembler->LoadObjectField(cell, PropertyCell::kValueOffset); |
| 2275 assembler->GotoIf(assembler->WordEqual(cell_value, invalid), | 2275 assembler->GotoIf(assembler->WordEqual(cell_value, invalid), |
| 2276 &generic_values); | 2276 &generic_values); |
| 2277 | 2277 |
| 2278 var_value.Bind(assembler->UndefinedConstant()); | 2278 var_value.Bind(assembler->UndefinedConstant()); |
| 2279 Node* value = assembler->LoadFixedDoubleArrayElement( | 2279 Node* value = assembler->LoadFixedDoubleArrayElement( |
| 2280 elements, index, MachineType::Float64(), 0, | 2280 elements, index, MachineType::Float64(), 0, |
| 2281 CodeStubAssembler::SMI_PARAMETERS, &allocate_entry_if_needed); | 2281 CodeStubAssembler::SMI_PARAMETERS, &allocate_entry_if_needed); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2583 Runtime::kThrowIncompatibleMethodReceiver, context, | 2583 Runtime::kThrowIncompatibleMethodReceiver, context, |
| 2584 assembler->HeapConstant(assembler->factory()->NewStringFromAsciiChecked( | 2584 assembler->HeapConstant(assembler->factory()->NewStringFromAsciiChecked( |
| 2585 "Array Iterator.prototype.next", TENURED)), | 2585 "Array Iterator.prototype.next", TENURED)), |
| 2586 iterator); | 2586 iterator); |
| 2587 assembler->Return(result); | 2587 assembler->Return(result); |
| 2588 } | 2588 } |
| 2589 } | 2589 } |
| 2590 | 2590 |
| 2591 } // namespace internal | 2591 } // namespace internal |
| 2592 } // namespace v8 | 2592 } // namespace v8 |
| OLD | NEW |