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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 | 1124 |
1125 // Convert the object to a JS object. | 1125 // Convert the object to a JS object. |
1126 Label convert, done_convert; | 1126 Label convert, done_convert; |
1127 __ JumpIfSmi(r0, &convert); | 1127 __ JumpIfSmi(r0, &convert); |
1128 __ CompareObjectType(r0, r1, r1, FIRST_SPEC_OBJECT_TYPE); | 1128 __ CompareObjectType(r0, r1, r1, FIRST_SPEC_OBJECT_TYPE); |
1129 __ b(ge, &done_convert); | 1129 __ b(ge, &done_convert); |
1130 __ bind(&convert); | 1130 __ bind(&convert); |
1131 __ push(r0); | 1131 __ push(r0); |
1132 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1132 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
1133 __ bind(&done_convert); | 1133 __ bind(&done_convert); |
| 1134 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
1134 __ push(r0); | 1135 __ push(r0); |
1135 | 1136 |
1136 // Check for proxies. | 1137 // Check for proxies. |
1137 Label call_runtime; | 1138 Label call_runtime; |
1138 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1139 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1139 __ CompareObjectType(r0, r1, r1, LAST_JS_PROXY_TYPE); | 1140 __ CompareObjectType(r0, r1, r1, LAST_JS_PROXY_TYPE); |
1140 __ b(le, &call_runtime); | 1141 __ b(le, &call_runtime); |
1141 | 1142 |
1142 // Check cache validity in generated code. This is a fast case for | 1143 // Check cache validity in generated code. This is a fast case for |
1143 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 1144 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
1144 // guarantee cache validity, call the runtime system to check cache | 1145 // guarantee cache validity, call the runtime system to check cache |
1145 // validity or get the property names in a fixed array. | 1146 // validity or get the property names in a fixed array. |
1146 __ CheckEnumCache(null_value, &call_runtime); | 1147 __ CheckEnumCache(null_value, &call_runtime); |
1147 | 1148 |
1148 // The enum cache is valid. Load the map of the object being | 1149 // The enum cache is valid. Load the map of the object being |
1149 // iterated over and use the cache for the iteration. | 1150 // iterated over and use the cache for the iteration. |
1150 Label use_cache; | 1151 Label use_cache; |
1151 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); | 1152 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); |
1152 __ b(&use_cache); | 1153 __ b(&use_cache); |
1153 | 1154 |
1154 // Get the set of properties to enumerate. | 1155 // Get the set of properties to enumerate. |
1155 __ bind(&call_runtime); | 1156 __ bind(&call_runtime); |
1156 __ push(r0); // Duplicate the enumerable object on the stack. | 1157 __ push(r0); // Duplicate the enumerable object on the stack. |
1157 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); | 1158 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); |
| 1159 PrepareForBailoutForId(stmt->EnumId(), TOS_REG); |
1158 | 1160 |
1159 // If we got a map from the runtime call, we can do a fast | 1161 // If we got a map from the runtime call, we can do a fast |
1160 // modification check. Otherwise, we got a fixed array, and we have | 1162 // modification check. Otherwise, we got a fixed array, and we have |
1161 // to do a slow check. | 1163 // to do a slow check. |
1162 Label fixed_array; | 1164 Label fixed_array; |
1163 __ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); | 1165 __ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); |
1164 __ LoadRoot(ip, Heap::kMetaMapRootIndex); | 1166 __ LoadRoot(ip, Heap::kMetaMapRootIndex); |
1165 __ cmp(r2, ip); | 1167 __ cmp(r2, ip); |
1166 __ b(ne, &fixed_array); | 1168 __ b(ne, &fixed_array); |
1167 | 1169 |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 int properties_count = constant_properties->length() / 2; | 1693 int properties_count = constant_properties->length() / 2; |
1692 if (expr->may_store_doubles() || expr->depth() > 1 || | 1694 if (expr->may_store_doubles() || expr->depth() > 1 || |
1693 masm()->serializer_enabled() || flags != ObjectLiteral::kFastElements || | 1695 masm()->serializer_enabled() || flags != ObjectLiteral::kFastElements || |
1694 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1696 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
1695 __ Push(r3, r2, r1, r0); | 1697 __ Push(r3, r2, r1, r0); |
1696 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1698 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1697 } else { | 1699 } else { |
1698 FastCloneShallowObjectStub stub(isolate(), properties_count); | 1700 FastCloneShallowObjectStub stub(isolate(), properties_count); |
1699 __ CallStub(&stub); | 1701 __ CallStub(&stub); |
1700 } | 1702 } |
| 1703 PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
1701 | 1704 |
1702 // If result_saved is true the result is on top of the stack. If | 1705 // If result_saved is true the result is on top of the stack. If |
1703 // result_saved is false the result is in r0. | 1706 // result_saved is false the result is in r0. |
1704 bool result_saved = false; | 1707 bool result_saved = false; |
1705 | 1708 |
1706 // Mark all computed expressions that are bound to a key that | 1709 // Mark all computed expressions that are bound to a key that |
1707 // is shadowed by a later occurrence of the same key. For the | 1710 // is shadowed by a later occurrence of the same key. For the |
1708 // marked expressions, no store code is emitted. | 1711 // marked expressions, no store code is emitted. |
1709 expr->CalculateEmitStore(zone()); | 1712 expr->CalculateEmitStore(zone()); |
1710 | 1713 |
(...skipping 3564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5275 | 5278 |
5276 DCHECK(interrupt_address == | 5279 DCHECK(interrupt_address == |
5277 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5280 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5278 return OSR_AFTER_STACK_CHECK; | 5281 return OSR_AFTER_STACK_CHECK; |
5279 } | 5282 } |
5280 | 5283 |
5281 | 5284 |
5282 } } // namespace v8::internal | 5285 } } // namespace v8::internal |
5283 | 5286 |
5284 #endif // V8_TARGET_ARCH_ARM | 5287 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |