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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 __ Push(r2, r1, r0); | 1069 __ Push(r2, r1, r0); |
1070 __ jmp(&loop); | 1070 __ jmp(&loop); |
1071 | 1071 |
1072 __ bind(&no_descriptors); | 1072 __ bind(&no_descriptors); |
1073 __ Drop(1); | 1073 __ Drop(1); |
1074 __ jmp(&exit); | 1074 __ jmp(&exit); |
1075 | 1075 |
1076 // We got a fixed array in register r0. Iterate through that. | 1076 // We got a fixed array in register r0. Iterate through that. |
1077 __ bind(&fixed_array); | 1077 __ bind(&fixed_array); |
1078 | 1078 |
1079 int const vector_index = SmiFromSlot(slot)->value(); | |
1080 __ EmitLoadTypeFeedbackVector(r1); | |
1081 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | |
1082 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(vector_index))); | |
1083 __ mov(r1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check | 1079 __ mov(r1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check |
1084 __ Push(r1, r0); // Smi and array | 1080 __ Push(r1, r0); // Smi and array |
1085 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); | 1081 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); |
1086 __ Push(r1); // Fixed array length (as smi). | 1082 __ Push(r1); // Fixed array length (as smi). |
1087 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); | 1083 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); |
1088 __ mov(r0, Operand(Smi::FromInt(0))); | 1084 __ mov(r0, Operand(Smi::FromInt(0))); |
1089 __ Push(r0); // Initial index. | 1085 __ Push(r0); // Initial index. |
1090 | 1086 |
1091 // Generate code for doing the condition check. | 1087 // Generate code for doing the condition check. |
1092 __ bind(&loop); | 1088 __ bind(&loop); |
(...skipping 14 matching lines...) Expand all Loading... |
1107 __ ldr(r2, MemOperand(sp, 3 * kPointerSize)); | 1103 __ ldr(r2, MemOperand(sp, 3 * kPointerSize)); |
1108 | 1104 |
1109 // Check if the expected map still matches that of the enumerable. | 1105 // Check if the expected map still matches that of the enumerable. |
1110 // If not, we may have to filter the key. | 1106 // If not, we may have to filter the key. |
1111 Label update_each; | 1107 Label update_each; |
1112 __ ldr(r1, MemOperand(sp, 4 * kPointerSize)); | 1108 __ ldr(r1, MemOperand(sp, 4 * kPointerSize)); |
1113 __ ldr(r4, FieldMemOperand(r1, HeapObject::kMapOffset)); | 1109 __ ldr(r4, FieldMemOperand(r1, HeapObject::kMapOffset)); |
1114 __ cmp(r4, Operand(r2)); | 1110 __ cmp(r4, Operand(r2)); |
1115 __ b(eq, &update_each); | 1111 __ b(eq, &update_each); |
1116 | 1112 |
1117 // We might get here from TurboFan or Crankshaft when something in the | 1113 // We need to filter the key, record slow-path here. |
1118 // for-in loop body deopts and only now notice in fullcodegen, that we | 1114 int const vector_index = SmiFromSlot(slot)->value(); |
1119 // can now longer use the enum cache, i.e. left fast mode. So better record | |
1120 // this information here, in case we later OSR back into this loop or | |
1121 // reoptimize the whole function w/o rerunning the loop with the slow | |
1122 // mode object in fullcodegen (which would result in a deopt loop). | |
1123 __ EmitLoadTypeFeedbackVector(r0); | 1115 __ EmitLoadTypeFeedbackVector(r0); |
1124 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1116 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1125 __ str(r2, FieldMemOperand(r0, FixedArray::OffsetOfElementAt(vector_index))); | 1117 __ str(r2, FieldMemOperand(r0, FixedArray::OffsetOfElementAt(vector_index))); |
1126 | 1118 |
1127 // Convert the entry to a string or (smi) 0 if it isn't a property | 1119 // Convert the entry to a string or (smi) 0 if it isn't a property |
1128 // any more. If the property has been removed while iterating, we | 1120 // any more. If the property has been removed while iterating, we |
1129 // just skip it. | 1121 // just skip it. |
1130 __ push(r1); // Enumerable. | 1122 __ push(r1); // Enumerable. |
1131 __ push(r3); // Current entry. | 1123 __ push(r3); // Current entry. |
1132 __ CallRuntime(Runtime::kForInFilter); | 1124 __ CallRuntime(Runtime::kForInFilter); |
(...skipping 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4267 DCHECK(interrupt_address == | 4259 DCHECK(interrupt_address == |
4268 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4260 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4269 return OSR_AFTER_STACK_CHECK; | 4261 return OSR_AFTER_STACK_CHECK; |
4270 } | 4262 } |
4271 | 4263 |
4272 | 4264 |
4273 } // namespace internal | 4265 } // namespace internal |
4274 } // namespace v8 | 4266 } // namespace v8 |
4275 | 4267 |
4276 #endif // V8_TARGET_ARCH_ARM | 4268 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |