OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 // Get the set of properties to enumerate. | 1084 // Get the set of properties to enumerate. |
1085 __ bind(&call_runtime); | 1085 __ bind(&call_runtime); |
1086 __ push(eax); | 1086 __ push(eax); |
1087 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); | 1087 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); |
1088 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), | 1088 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), |
1089 isolate()->factory()->meta_map()); | 1089 isolate()->factory()->meta_map()); |
1090 __ j(not_equal, &fixed_array); | 1090 __ j(not_equal, &fixed_array); |
1091 | 1091 |
1092 | 1092 |
1093 // We got a map in register eax. Get the enumeration cache from it. | 1093 // We got a map in register eax. Get the enumeration cache from it. |
| 1094 Label no_descriptors; |
1094 __ bind(&use_cache); | 1095 __ bind(&use_cache); |
| 1096 |
| 1097 __ EnumLength(edx, eax); |
| 1098 __ cmp(edx, Immediate(Smi::FromInt(0))); |
| 1099 __ j(equal, &no_descriptors); |
| 1100 |
1095 __ LoadInstanceDescriptors(eax, ecx); | 1101 __ LoadInstanceDescriptors(eax, ecx); |
1096 __ mov(ecx, FieldOperand(ecx, DescriptorArray::kEnumCacheOffset)); | 1102 __ mov(ecx, FieldOperand(ecx, DescriptorArray::kEnumCacheOffset)); |
1097 __ mov(edx, FieldOperand(ecx, DescriptorArray::kEnumCacheBridgeCacheOffset)); | 1103 __ mov(ecx, FieldOperand(ecx, DescriptorArray::kEnumCacheBridgeCacheOffset)); |
1098 | 1104 |
1099 // Set up the four remaining stack slots. | 1105 // Set up the four remaining stack slots. |
1100 __ push(eax); // Map. | 1106 __ push(eax); // Map. |
1101 __ push(edx); // Enumeration cache. | 1107 __ push(ecx); // Enumeration cache. |
1102 __ mov(eax, FieldOperand(edx, FixedArray::kLengthOffset)); | 1108 __ push(edx); // Number of valid entries for the map in the enum cache. |
1103 __ push(eax); // Enumeration cache length (as smi). | |
1104 __ push(Immediate(Smi::FromInt(0))); // Initial index. | 1109 __ push(Immediate(Smi::FromInt(0))); // Initial index. |
1105 __ jmp(&loop); | 1110 __ jmp(&loop); |
1106 | 1111 |
| 1112 __ bind(&no_descriptors); |
| 1113 __ add(esp, Immediate(kPointerSize)); |
| 1114 __ jmp(&exit); |
| 1115 |
1107 // We got a fixed array in register eax. Iterate through that. | 1116 // We got a fixed array in register eax. Iterate through that. |
1108 Label non_proxy; | 1117 Label non_proxy; |
1109 __ bind(&fixed_array); | 1118 __ bind(&fixed_array); |
1110 | 1119 |
1111 Handle<JSGlobalPropertyCell> cell = | 1120 Handle<JSGlobalPropertyCell> cell = |
1112 isolate()->factory()->NewJSGlobalPropertyCell( | 1121 isolate()->factory()->NewJSGlobalPropertyCell( |
1113 Handle<Object>( | 1122 Handle<Object>( |
1114 Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker))); | 1123 Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker))); |
1115 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); | 1124 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); |
1116 __ LoadHeapObject(ebx, cell); | 1125 __ LoadHeapObject(ebx, cell); |
(...skipping 3429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4546 *stack_depth = 0; | 4555 *stack_depth = 0; |
4547 *context_length = 0; | 4556 *context_length = 0; |
4548 return previous_; | 4557 return previous_; |
4549 } | 4558 } |
4550 | 4559 |
4551 #undef __ | 4560 #undef __ |
4552 | 4561 |
4553 } } // namespace v8::internal | 4562 } } // namespace v8::internal |
4554 | 4563 |
4555 #endif // V8_TARGET_ARCH_IA32 | 4564 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |