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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 __ Push(r5, r4, r3); | 1031 __ Push(r5, r4, r3); |
1032 __ b(&loop); | 1032 __ b(&loop); |
1033 | 1033 |
1034 __ bind(&no_descriptors); | 1034 __ bind(&no_descriptors); |
1035 __ Drop(1); | 1035 __ Drop(1); |
1036 __ b(&exit); | 1036 __ b(&exit); |
1037 | 1037 |
1038 // We got a fixed array in register r3. Iterate through that. | 1038 // We got a fixed array in register r3. Iterate through that. |
1039 __ bind(&fixed_array); | 1039 __ bind(&fixed_array); |
1040 | 1040 |
1041 int const vector_index = SmiFromSlot(slot)->value(); | |
1042 __ EmitLoadTypeFeedbackVector(r4); | |
1043 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | |
1044 __ StoreP( | |
1045 r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0); | |
1046 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check | 1041 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check |
1047 __ Push(r4, r3); // Smi and array | 1042 __ Push(r4, r3); // Smi and array |
1048 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 1043 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
1049 __ Push(r4); // Fixed array length (as smi). | 1044 __ Push(r4); // Fixed array length (as smi). |
1050 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); | 1045 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); |
1051 __ LoadSmiLiteral(r3, Smi::FromInt(0)); | 1046 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
1052 __ Push(r3); // Initial index. | 1047 __ Push(r3); // Initial index. |
1053 | 1048 |
1054 // Generate code for doing the condition check. | 1049 // Generate code for doing the condition check. |
1055 __ bind(&loop); | 1050 __ bind(&loop); |
(...skipping 16 matching lines...) Expand all Loading... |
1072 __ LoadP(r5, MemOperand(sp, 3 * kPointerSize)); | 1067 __ LoadP(r5, MemOperand(sp, 3 * kPointerSize)); |
1073 | 1068 |
1074 // Check if the expected map still matches that of the enumerable. | 1069 // Check if the expected map still matches that of the enumerable. |
1075 // If not, we may have to filter the key. | 1070 // If not, we may have to filter the key. |
1076 Label update_each; | 1071 Label update_each; |
1077 __ LoadP(r4, MemOperand(sp, 4 * kPointerSize)); | 1072 __ LoadP(r4, MemOperand(sp, 4 * kPointerSize)); |
1078 __ LoadP(r7, FieldMemOperand(r4, HeapObject::kMapOffset)); | 1073 __ LoadP(r7, FieldMemOperand(r4, HeapObject::kMapOffset)); |
1079 __ cmp(r7, r5); | 1074 __ cmp(r7, r5); |
1080 __ beq(&update_each); | 1075 __ beq(&update_each); |
1081 | 1076 |
1082 // We might get here from TurboFan or Crankshaft when something in the | 1077 // We need to filter the key, record slow-path here. |
1083 // for-in loop body deopts and only now notice in fullcodegen, that we | 1078 int const vector_index = SmiFromSlot(slot)->value(); |
1084 // can now longer use the enum cache, i.e. left fast mode. So better record | |
1085 // this information here, in case we later OSR back into this loop or | |
1086 // reoptimize the whole function w/o rerunning the loop with the slow | |
1087 // mode object in fullcodegen (which would result in a deopt loop). | |
1088 __ EmitLoadTypeFeedbackVector(r3); | 1079 __ EmitLoadTypeFeedbackVector(r3); |
1089 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1080 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1090 __ StoreP( | 1081 __ StoreP( |
1091 r5, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index)), r0); | 1082 r5, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index)), r0); |
1092 | 1083 |
1093 // Convert the entry to a string or (smi) 0 if it isn't a property | 1084 // Convert the entry to a string or (smi) 0 if it isn't a property |
1094 // any more. If the property has been removed while iterating, we | 1085 // any more. If the property has been removed while iterating, we |
1095 // just skip it. | 1086 // just skip it. |
1096 __ Push(r4, r6); // Enumerable and current entry. | 1087 __ Push(r4, r6); // Enumerable and current entry. |
1097 __ CallRuntime(Runtime::kForInFilter); | 1088 __ CallRuntime(Runtime::kForInFilter); |
(...skipping 3088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4186 return ON_STACK_REPLACEMENT; | 4177 return ON_STACK_REPLACEMENT; |
4187 } | 4178 } |
4188 | 4179 |
4189 DCHECK(interrupt_address == | 4180 DCHECK(interrupt_address == |
4190 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4181 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4191 return OSR_AFTER_STACK_CHECK; | 4182 return OSR_AFTER_STACK_CHECK; |
4192 } | 4183 } |
4193 } // namespace internal | 4184 } // namespace internal |
4194 } // namespace v8 | 4185 } // namespace v8 |
4195 #endif // V8_TARGET_ARCH_PPC | 4186 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |