| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 __ Push(v0, a2, a1, a0); | 1066 __ Push(v0, a2, a1, a0); |
| 1067 __ jmp(&loop); | 1067 __ jmp(&loop); |
| 1068 | 1068 |
| 1069 __ bind(&no_descriptors); | 1069 __ bind(&no_descriptors); |
| 1070 __ Drop(1); | 1070 __ Drop(1); |
| 1071 __ jmp(&exit); | 1071 __ jmp(&exit); |
| 1072 | 1072 |
| 1073 // We got a fixed array in register v0. Iterate through that. | 1073 // We got a fixed array in register v0. Iterate through that. |
| 1074 __ bind(&fixed_array); | 1074 __ bind(&fixed_array); |
| 1075 | 1075 |
| 1076 int const vector_index = SmiFromSlot(slot)->value(); | |
| 1077 __ EmitLoadTypeFeedbackVector(a1); | |
| 1078 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | |
| 1079 __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); | |
| 1080 | |
| 1081 __ li(a1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check | 1076 __ li(a1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check |
| 1082 __ Push(a1, v0); // Smi and array | 1077 __ Push(a1, v0); // Smi and array |
| 1083 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); | 1078 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); |
| 1084 __ Push(a1); // Fixed array length (as smi). | 1079 __ Push(a1); // Fixed array length (as smi). |
| 1085 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); | 1080 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); |
| 1086 __ li(a0, Operand(Smi::FromInt(0))); | 1081 __ li(a0, Operand(Smi::FromInt(0))); |
| 1087 __ Push(a0); // Initial index. | 1082 __ Push(a0); // Initial index. |
| 1088 | 1083 |
| 1089 // Generate code for doing the condition check. | 1084 // Generate code for doing the condition check. |
| 1090 __ bind(&loop); | 1085 __ bind(&loop); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1106 // permanent slow case into register a2. | 1101 // permanent slow case into register a2. |
| 1107 __ ld(a2, MemOperand(sp, 3 * kPointerSize)); | 1102 __ ld(a2, MemOperand(sp, 3 * kPointerSize)); |
| 1108 | 1103 |
| 1109 // Check if the expected map still matches that of the enumerable. | 1104 // Check if the expected map still matches that of the enumerable. |
| 1110 // If not, we may have to filter the key. | 1105 // If not, we may have to filter the key. |
| 1111 Label update_each; | 1106 Label update_each; |
| 1112 __ ld(a1, MemOperand(sp, 4 * kPointerSize)); | 1107 __ ld(a1, MemOperand(sp, 4 * kPointerSize)); |
| 1113 __ ld(a4, FieldMemOperand(a1, HeapObject::kMapOffset)); | 1108 __ ld(a4, FieldMemOperand(a1, HeapObject::kMapOffset)); |
| 1114 __ Branch(&update_each, eq, a4, Operand(a2)); | 1109 __ Branch(&update_each, eq, a4, Operand(a2)); |
| 1115 | 1110 |
| 1116 // We might get here from TurboFan or Crankshaft when something in the | 1111 // We need to filter the key, record slow-path here. |
| 1117 // for-in loop body deopts and only now notice in fullcodegen, that we | 1112 int const vector_index = SmiFromSlot(slot)->value(); |
| 1118 // can now longer use the enum cache, i.e. left fast mode. So better record | |
| 1119 // this information here, in case we later OSR back into this loop or | |
| 1120 // reoptimize the whole function w/o rerunning the loop with the slow | |
| 1121 // mode object in fullcodegen (which would result in a deopt loop). | |
| 1122 __ EmitLoadTypeFeedbackVector(a0); | 1113 __ EmitLoadTypeFeedbackVector(a0); |
| 1123 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1114 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1124 __ sd(a2, FieldMemOperand(a0, FixedArray::OffsetOfElementAt(vector_index))); | 1115 __ sd(a2, FieldMemOperand(a0, FixedArray::OffsetOfElementAt(vector_index))); |
| 1125 | 1116 |
| 1126 // Convert the entry to a string or (smi) 0 if it isn't a property | 1117 // Convert the entry to a string or (smi) 0 if it isn't a property |
| 1127 // any more. If the property has been removed while iterating, we | 1118 // any more. If the property has been removed while iterating, we |
| 1128 // just skip it. | 1119 // just skip it. |
| 1129 __ Push(a1, a3); // Enumerable and current entry. | 1120 __ Push(a1, a3); // Enumerable and current entry. |
| 1130 __ CallRuntime(Runtime::kForInFilter); | 1121 __ CallRuntime(Runtime::kForInFilter); |
| 1131 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); | 1122 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); |
| (...skipping 3096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4228 reinterpret_cast<uint64_t>( | 4219 reinterpret_cast<uint64_t>( |
| 4229 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4220 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4230 return OSR_AFTER_STACK_CHECK; | 4221 return OSR_AFTER_STACK_CHECK; |
| 4231 } | 4222 } |
| 4232 | 4223 |
| 4233 | 4224 |
| 4234 } // namespace internal | 4225 } // namespace internal |
| 4235 } // namespace v8 | 4226 } // namespace v8 |
| 4236 | 4227 |
| 4237 #endif // V8_TARGET_ARCH_MIPS64 | 4228 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |