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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 __ JumpIfObjectType(x0, x10, x11, FIRST_JS_RECEIVER_TYPE, &done_convert, ge); | 1050 __ JumpIfObjectType(x0, x10, x11, FIRST_JS_RECEIVER_TYPE, &done_convert, ge); |
1051 __ Bind(&convert); | 1051 __ Bind(&convert); |
1052 ToObjectStub stub(isolate()); | 1052 ToObjectStub stub(isolate()); |
1053 __ CallStub(&stub); | 1053 __ CallStub(&stub); |
1054 __ Bind(&done_convert); | 1054 __ Bind(&done_convert); |
1055 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); | 1055 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
1056 __ Push(x0); | 1056 __ Push(x0); |
1057 | 1057 |
1058 // Check for proxies. | 1058 // Check for proxies. |
1059 Label call_runtime; | 1059 Label call_runtime; |
1060 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | 1060 __ JumpIfObjectType(x0, x10, x11, JS_PROXY_TYPE, &call_runtime, eq); |
1061 __ JumpIfObjectType(x0, x10, x11, LAST_JS_PROXY_TYPE, &call_runtime, le); | |
1062 | 1061 |
1063 // Check cache validity in generated code. This is a fast case for | 1062 // Check cache validity in generated code. This is a fast case for |
1064 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 1063 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
1065 // guarantee cache validity, call the runtime system to check cache | 1064 // guarantee cache validity, call the runtime system to check cache |
1066 // validity or get the property names in a fixed array. | 1065 // validity or get the property names in a fixed array. |
1067 __ CheckEnumCache(x0, null_value, x10, x11, x12, x13, &call_runtime); | 1066 __ CheckEnumCache(x0, null_value, x10, x11, x12, x13, &call_runtime); |
1068 | 1067 |
1069 // The enum cache is valid. Load the map of the object being | 1068 // The enum cache is valid. Load the map of the object being |
1070 // iterated over and use the cache for the iteration. | 1069 // iterated over and use the cache for the iteration. |
1071 Label use_cache; | 1070 Label use_cache; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 // We got a fixed array in register x0. Iterate through that. | 1108 // We got a fixed array in register x0. Iterate through that. |
1110 __ Bind(&fixed_array); | 1109 __ Bind(&fixed_array); |
1111 | 1110 |
1112 __ EmitLoadTypeFeedbackVector(x1); | 1111 __ EmitLoadTypeFeedbackVector(x1); |
1113 __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1112 __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1114 int vector_index = SmiFromSlot(slot)->value(); | 1113 int vector_index = SmiFromSlot(slot)->value(); |
1115 __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(vector_index))); | 1114 __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(vector_index))); |
1116 | 1115 |
1117 __ Mov(x1, Smi::FromInt(1)); // Smi indicates slow check. | 1116 __ Mov(x1, Smi::FromInt(1)); // Smi indicates slow check. |
1118 __ Peek(x10, 0); // Get enumerated object. | 1117 __ Peek(x10, 0); // Get enumerated object. |
1119 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | 1118 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); |
1120 // TODO(all): similar check was done already. Can we avoid it here? | 1119 __ CompareObjectType(x10, x11, x12, JS_PROXY_TYPE); |
1121 __ CompareObjectType(x10, x11, x12, LAST_JS_PROXY_TYPE); | |
1122 DCHECK(Smi::FromInt(0) == 0); | 1120 DCHECK(Smi::FromInt(0) == 0); |
1123 __ CzeroX(x1, le); // Zero indicates proxy. | 1121 __ CzeroX(x1, eq); // Zero indicates proxy. |
1124 __ Ldr(x2, FieldMemOperand(x0, FixedArray::kLengthOffset)); | 1122 __ Ldr(x2, FieldMemOperand(x0, FixedArray::kLengthOffset)); |
1125 // Smi and array, fixed array length (as smi) and initial index. | 1123 // Smi and array, fixed array length (as smi) and initial index. |
1126 __ Push(x1, x0, x2, xzr); | 1124 __ Push(x1, x0, x2, xzr); |
1127 | 1125 |
1128 // Generate code for doing the condition check. | 1126 // Generate code for doing the condition check. |
1129 __ Bind(&loop); | 1127 __ Bind(&loop); |
1130 SetExpressionAsStatementPosition(stmt->each()); | 1128 SetExpressionAsStatementPosition(stmt->each()); |
1131 | 1129 |
1132 // Load the current count to x0, load the length to x1. | 1130 // Load the current count to x0, load the length to x1. |
1133 __ PeekPair(x0, x1, 0); | 1131 __ PeekPair(x0, x1, 0); |
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2969 VisitForAccumulatorValue(args->at(0)); | 2967 VisitForAccumulatorValue(args->at(0)); |
2970 | 2968 |
2971 Label materialize_true, materialize_false; | 2969 Label materialize_true, materialize_false; |
2972 Label* if_true = NULL; | 2970 Label* if_true = NULL; |
2973 Label* if_false = NULL; | 2971 Label* if_false = NULL; |
2974 Label* fall_through = NULL; | 2972 Label* fall_through = NULL; |
2975 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 2973 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
2976 &if_false, &fall_through); | 2974 &if_false, &fall_through); |
2977 | 2975 |
2978 __ JumpIfSmi(x0, if_false); | 2976 __ JumpIfSmi(x0, if_false); |
2979 Register map = x10; | 2977 __ CompareObjectType(x0, x10, x11, JS_PROXY_TYPE); |
2980 Register type_reg = x11; | |
2981 __ Ldr(map, FieldMemOperand(x0, HeapObject::kMapOffset)); | |
2982 __ Ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | |
2983 __ Sub(type_reg, type_reg, Operand(FIRST_JS_PROXY_TYPE)); | |
2984 __ Cmp(type_reg, Operand(LAST_JS_PROXY_TYPE - FIRST_JS_PROXY_TYPE)); | |
2985 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 2978 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
2986 Split(ls, if_true, if_false, fall_through); | 2979 Split(eq, if_true, if_false, fall_through); |
2987 | 2980 |
2988 context()->Plug(if_true, if_false); | 2981 context()->Plug(if_true, if_false); |
2989 } | 2982 } |
2990 | 2983 |
2991 | 2984 |
2992 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { | 2985 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { |
2993 ZoneList<Expression*>* args = expr->arguments(); | 2986 ZoneList<Expression*>* args = expr->arguments(); |
2994 DCHECK(args->length() == 2); | 2987 DCHECK(args->length() == 2); |
2995 | 2988 |
2996 // Load the two objects into registers and perform the comparison. | 2989 // Load the two objects into registers and perform the comparison. |
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4951 } | 4944 } |
4952 | 4945 |
4953 return INTERRUPT; | 4946 return INTERRUPT; |
4954 } | 4947 } |
4955 | 4948 |
4956 | 4949 |
4957 } // namespace internal | 4950 } // namespace internal |
4958 } // namespace v8 | 4951 } // namespace v8 |
4959 | 4952 |
4960 #endif // V8_TARGET_ARCH_ARM64 | 4953 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |