OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); | 1117 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); |
1118 | 1118 |
1119 // Convert the object to a JS object. | 1119 // Convert the object to a JS object. |
1120 Label convert, done_convert; | 1120 Label convert, done_convert; |
1121 __ JumpIfSmi(x0, &convert); | 1121 __ JumpIfSmi(x0, &convert); |
1122 __ JumpIfObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE, &done_convert, ge); | 1122 __ JumpIfObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE, &done_convert, ge); |
1123 __ Bind(&convert); | 1123 __ Bind(&convert); |
1124 __ Push(x0); | 1124 __ Push(x0); |
1125 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1125 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
1126 __ Bind(&done_convert); | 1126 __ Bind(&done_convert); |
| 1127 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
1127 __ Push(x0); | 1128 __ Push(x0); |
1128 | 1129 |
1129 // Check for proxies. | 1130 // Check for proxies. |
1130 Label call_runtime; | 1131 Label call_runtime; |
1131 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1132 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1132 __ JumpIfObjectType(x0, x10, x11, LAST_JS_PROXY_TYPE, &call_runtime, le); | 1133 __ JumpIfObjectType(x0, x10, x11, LAST_JS_PROXY_TYPE, &call_runtime, le); |
1133 | 1134 |
1134 // Check cache validity in generated code. This is a fast case for | 1135 // Check cache validity in generated code. This is a fast case for |
1135 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 1136 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
1136 // guarantee cache validity, call the runtime system to check cache | 1137 // guarantee cache validity, call the runtime system to check cache |
1137 // validity or get the property names in a fixed array. | 1138 // validity or get the property names in a fixed array. |
1138 __ CheckEnumCache(x0, null_value, x10, x11, x12, x13, &call_runtime); | 1139 __ CheckEnumCache(x0, null_value, x10, x11, x12, x13, &call_runtime); |
1139 | 1140 |
1140 // The enum cache is valid. Load the map of the object being | 1141 // The enum cache is valid. Load the map of the object being |
1141 // iterated over and use the cache for the iteration. | 1142 // iterated over and use the cache for the iteration. |
1142 Label use_cache; | 1143 Label use_cache; |
1143 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); | 1144 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); |
1144 __ B(&use_cache); | 1145 __ B(&use_cache); |
1145 | 1146 |
1146 // Get the set of properties to enumerate. | 1147 // Get the set of properties to enumerate. |
1147 __ Bind(&call_runtime); | 1148 __ Bind(&call_runtime); |
1148 __ Push(x0); // Duplicate the enumerable object on the stack. | 1149 __ Push(x0); // Duplicate the enumerable object on the stack. |
1149 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); | 1150 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); |
| 1151 PrepareForBailoutForId(stmt->EnumId(), TOS_REG); |
1150 | 1152 |
1151 // If we got a map from the runtime call, we can do a fast | 1153 // If we got a map from the runtime call, we can do a fast |
1152 // modification check. Otherwise, we got a fixed array, and we have | 1154 // modification check. Otherwise, we got a fixed array, and we have |
1153 // to do a slow check. | 1155 // to do a slow check. |
1154 Label fixed_array, no_descriptors; | 1156 Label fixed_array, no_descriptors; |
1155 __ Ldr(x2, FieldMemOperand(x0, HeapObject::kMapOffset)); | 1157 __ Ldr(x2, FieldMemOperand(x0, HeapObject::kMapOffset)); |
1156 __ JumpIfNotRoot(x2, Heap::kMetaMapRootIndex, &fixed_array); | 1158 __ JumpIfNotRoot(x2, Heap::kMetaMapRootIndex, &fixed_array); |
1157 | 1159 |
1158 // We got a map in register x0. Get the enumeration cache from it. | 1160 // We got a map in register x0. Get the enumeration cache from it. |
1159 __ Bind(&use_cache); | 1161 __ Bind(&use_cache); |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1671 FastCloneShallowObjectStub::kMaximumClonedProperties; | 1673 FastCloneShallowObjectStub::kMaximumClonedProperties; |
1672 if (expr->may_store_doubles() || expr->depth() > 1 || | 1674 if (expr->may_store_doubles() || expr->depth() > 1 || |
1673 masm()->serializer_enabled() || flags != ObjectLiteral::kFastElements || | 1675 masm()->serializer_enabled() || flags != ObjectLiteral::kFastElements || |
1674 properties_count > max_cloned_properties) { | 1676 properties_count > max_cloned_properties) { |
1675 __ Push(x3, x2, x1, x0); | 1677 __ Push(x3, x2, x1, x0); |
1676 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1678 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1677 } else { | 1679 } else { |
1678 FastCloneShallowObjectStub stub(isolate(), properties_count); | 1680 FastCloneShallowObjectStub stub(isolate(), properties_count); |
1679 __ CallStub(&stub); | 1681 __ CallStub(&stub); |
1680 } | 1682 } |
| 1683 PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
1681 | 1684 |
1682 // If result_saved is true the result is on top of the stack. If | 1685 // If result_saved is true the result is on top of the stack. If |
1683 // result_saved is false the result is in x0. | 1686 // result_saved is false the result is in x0. |
1684 bool result_saved = false; | 1687 bool result_saved = false; |
1685 | 1688 |
1686 // Mark all computed expressions that are bound to a key that | 1689 // Mark all computed expressions that are bound to a key that |
1687 // is shadowed by a later occurrence of the same key. For the | 1690 // is shadowed by a later occurrence of the same key. For the |
1688 // marked expressions, no store code is emitted. | 1691 // marked expressions, no store code is emitted. |
1689 expr->CalculateEmitStore(zone()); | 1692 expr->CalculateEmitStore(zone()); |
1690 | 1693 |
(...skipping 3566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5257 return previous_; | 5260 return previous_; |
5258 } | 5261 } |
5259 | 5262 |
5260 | 5263 |
5261 #undef __ | 5264 #undef __ |
5262 | 5265 |
5263 | 5266 |
5264 } } // namespace v8::internal | 5267 } } // namespace v8::internal |
5265 | 5268 |
5266 #endif // V8_TARGET_ARCH_ARM64 | 5269 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |