OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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(r5, r4, r3); | 1069 __ Push(r5, r4, r3); |
1070 __ b(&loop); | 1070 __ b(&loop); |
1071 | 1071 |
1072 __ bind(&no_descriptors); | 1072 __ bind(&no_descriptors); |
1073 __ Drop(1); | 1073 __ Drop(1); |
1074 __ b(&exit); | 1074 __ b(&exit); |
1075 | 1075 |
1076 // We got a fixed array in register r3. Iterate through that. | 1076 // We got a fixed array in register r3. Iterate through that. |
1077 __ bind(&fixed_array); | 1077 __ bind(&fixed_array); |
1078 | 1078 |
| 1079 int const vector_index = SmiFromSlot(slot)->value(); |
1079 __ EmitLoadTypeFeedbackVector(r4); | 1080 __ EmitLoadTypeFeedbackVector(r4); |
1080 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1081 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1081 int vector_index = SmiFromSlot(slot)->value(); | |
1082 __ StoreP( | 1082 __ StoreP( |
1083 r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0); | 1083 r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0); |
1084 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check | 1084 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check |
1085 __ Push(r4, r3); // Smi and array | 1085 __ Push(r4, r3); // Smi and array |
1086 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 1086 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
1087 __ Push(r4); // Fixed array length (as smi). | 1087 __ Push(r4); // Fixed array length (as smi). |
1088 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); | 1088 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); |
1089 __ LoadSmiLiteral(r3, Smi::FromInt(0)); | 1089 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
1090 __ Push(r3); // Initial index. | 1090 __ Push(r3); // Initial index. |
1091 | 1091 |
(...skipping 18 matching lines...) Expand all Loading... |
1110 __ LoadP(r5, MemOperand(sp, 3 * kPointerSize)); | 1110 __ LoadP(r5, MemOperand(sp, 3 * kPointerSize)); |
1111 | 1111 |
1112 // Check if the expected map still matches that of the enumerable. | 1112 // Check if the expected map still matches that of the enumerable. |
1113 // If not, we may have to filter the key. | 1113 // If not, we may have to filter the key. |
1114 Label update_each; | 1114 Label update_each; |
1115 __ LoadP(r4, MemOperand(sp, 4 * kPointerSize)); | 1115 __ LoadP(r4, MemOperand(sp, 4 * kPointerSize)); |
1116 __ LoadP(r7, FieldMemOperand(r4, HeapObject::kMapOffset)); | 1116 __ LoadP(r7, FieldMemOperand(r4, HeapObject::kMapOffset)); |
1117 __ cmp(r7, r5); | 1117 __ cmp(r7, r5); |
1118 __ beq(&update_each); | 1118 __ beq(&update_each); |
1119 | 1119 |
| 1120 // We might get here from TurboFan or Crankshaft when something in the |
| 1121 // for-in loop body deopts and only now notice in fullcodegen, that we |
| 1122 // can now longer use the enum cache, i.e. left fast mode. So better record |
| 1123 // this information here, in case we later OSR back into this loop or |
| 1124 // reoptimize the whole function w/o rerunning the loop with the slow |
| 1125 // mode object in fullcodegen (which would result in a deopt loop). |
| 1126 __ EmitLoadTypeFeedbackVector(r3); |
| 1127 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1128 __ StoreP( |
| 1129 r5, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index)), r0); |
| 1130 |
1120 // Convert the entry to a string or (smi) 0 if it isn't a property | 1131 // Convert the entry to a string or (smi) 0 if it isn't a property |
1121 // any more. If the property has been removed while iterating, we | 1132 // any more. If the property has been removed while iterating, we |
1122 // just skip it. | 1133 // just skip it. |
1123 __ Push(r4, r6); // Enumerable and current entry. | 1134 __ Push(r4, r6); // Enumerable and current entry. |
1124 __ CallRuntime(Runtime::kForInFilter); | 1135 __ CallRuntime(Runtime::kForInFilter); |
1125 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); | 1136 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); |
1126 __ mr(r6, r3); | 1137 __ mr(r6, r3); |
1127 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 1138 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
1128 __ cmp(r3, r0); | 1139 __ cmp(r3, r0); |
1129 __ beq(loop_statement.continue_label()); | 1140 __ beq(loop_statement.continue_label()); |
(...skipping 3663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4793 return ON_STACK_REPLACEMENT; | 4804 return ON_STACK_REPLACEMENT; |
4794 } | 4805 } |
4795 | 4806 |
4796 DCHECK(interrupt_address == | 4807 DCHECK(interrupt_address == |
4797 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4808 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4798 return OSR_AFTER_STACK_CHECK; | 4809 return OSR_AFTER_STACK_CHECK; |
4799 } | 4810 } |
4800 } // namespace internal | 4811 } // namespace internal |
4801 } // namespace v8 | 4812 } // namespace v8 |
4802 #endif // V8_TARGET_ARCH_PPC | 4813 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |