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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 __ jmp(&loop); | 1032 __ jmp(&loop); |
1033 | 1033 |
1034 __ bind(&no_descriptors); | 1034 __ bind(&no_descriptors); |
1035 __ add(esp, Immediate(kPointerSize)); | 1035 __ add(esp, Immediate(kPointerSize)); |
1036 __ jmp(&exit); | 1036 __ jmp(&exit); |
1037 | 1037 |
1038 // We got a fixed array in register eax. Iterate through that. | 1038 // We got a fixed array in register eax. Iterate through that. |
1039 __ bind(&fixed_array); | 1039 __ bind(&fixed_array); |
1040 | 1040 |
1041 // No need for a write barrier, we are storing a Smi in the feedback vector. | 1041 // No need for a write barrier, we are storing a Smi in the feedback vector. |
| 1042 int const vector_index = SmiFromSlot(slot)->value(); |
1042 __ EmitLoadTypeFeedbackVector(ebx); | 1043 __ EmitLoadTypeFeedbackVector(ebx); |
1043 int vector_index = SmiFromSlot(slot)->value(); | |
1044 __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(vector_index)), | 1044 __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(vector_index)), |
1045 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1045 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1046 __ push(Immediate(Smi::FromInt(1))); // Smi(1) undicates slow check | 1046 __ push(Immediate(Smi::FromInt(1))); // Smi(1) undicates slow check |
1047 __ push(eax); // Array | 1047 __ push(eax); // Array |
1048 __ mov(eax, FieldOperand(eax, FixedArray::kLengthOffset)); | 1048 __ mov(eax, FieldOperand(eax, FixedArray::kLengthOffset)); |
1049 __ push(eax); // Fixed array length (as smi). | 1049 __ push(eax); // Fixed array length (as smi). |
1050 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); | 1050 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); |
1051 __ push(Immediate(Smi::FromInt(0))); // Initial index. | 1051 __ push(Immediate(Smi::FromInt(0))); // Initial index. |
1052 | 1052 |
1053 // Generate code for doing the condition check. | 1053 // Generate code for doing the condition check. |
(...skipping 12 matching lines...) Expand all Loading... |
1066 // permanent slow case into register edx. | 1066 // permanent slow case into register edx. |
1067 __ mov(edx, Operand(esp, 3 * kPointerSize)); | 1067 __ mov(edx, Operand(esp, 3 * kPointerSize)); |
1068 | 1068 |
1069 // Check if the expected map still matches that of the enumerable. | 1069 // Check if the expected map still matches that of the enumerable. |
1070 // If not, we may have to filter the key. | 1070 // If not, we may have to filter the key. |
1071 Label update_each; | 1071 Label update_each; |
1072 __ mov(ecx, Operand(esp, 4 * kPointerSize)); | 1072 __ mov(ecx, Operand(esp, 4 * kPointerSize)); |
1073 __ cmp(edx, FieldOperand(ecx, HeapObject::kMapOffset)); | 1073 __ cmp(edx, FieldOperand(ecx, HeapObject::kMapOffset)); |
1074 __ j(equal, &update_each, Label::kNear); | 1074 __ j(equal, &update_each, Label::kNear); |
1075 | 1075 |
| 1076 // We might get here from TurboFan or Crankshaft when something in the |
| 1077 // for-in loop body deopts and only now notice in fullcodegen, that we |
| 1078 // can now longer use the enum cache, i.e. left fast mode. So better record |
| 1079 // this information here, in case we later OSR back into this loop or |
| 1080 // reoptimize the whole function w/o rerunning the loop with the slow |
| 1081 // mode object in fullcodegen (which would result in a deopt loop). |
| 1082 __ EmitLoadTypeFeedbackVector(edx); |
| 1083 __ mov(FieldOperand(edx, FixedArray::OffsetOfElementAt(vector_index)), |
| 1084 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1085 |
1076 // Convert the entry to a string or null if it isn't a property | 1086 // Convert the entry to a string or null if it isn't a property |
1077 // anymore. If the property has been removed while iterating, we | 1087 // anymore. If the property has been removed while iterating, we |
1078 // just skip it. | 1088 // just skip it. |
1079 __ push(ecx); // Enumerable. | 1089 __ push(ecx); // Enumerable. |
1080 __ push(ebx); // Current entry. | 1090 __ push(ebx); // Current entry. |
1081 __ CallRuntime(Runtime::kForInFilter); | 1091 __ CallRuntime(Runtime::kForInFilter); |
1082 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); | 1092 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); |
1083 __ cmp(eax, isolate()->factory()->undefined_value()); | 1093 __ cmp(eax, isolate()->factory()->undefined_value()); |
1084 __ j(equal, loop_statement.continue_label()); | 1094 __ j(equal, loop_statement.continue_label()); |
1085 __ mov(ebx, eax); | 1095 __ mov(ebx, eax); |
(...skipping 3628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4714 Assembler::target_address_at(call_target_address, | 4724 Assembler::target_address_at(call_target_address, |
4715 unoptimized_code)); | 4725 unoptimized_code)); |
4716 return OSR_AFTER_STACK_CHECK; | 4726 return OSR_AFTER_STACK_CHECK; |
4717 } | 4727 } |
4718 | 4728 |
4719 | 4729 |
4720 } // namespace internal | 4730 } // namespace internal |
4721 } // namespace v8 | 4731 } // namespace v8 |
4722 | 4732 |
4723 #endif // V8_TARGET_ARCH_X87 | 4733 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |