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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 __ bind(&convert); | 1048 __ bind(&convert); |
1049 ToObjectStub stub(isolate()); | 1049 ToObjectStub stub(isolate()); |
1050 __ CallStub(&stub); | 1050 __ CallStub(&stub); |
1051 __ mov(a0, v0); | 1051 __ mov(a0, v0); |
1052 __ bind(&done_convert); | 1052 __ bind(&done_convert); |
1053 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); | 1053 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
1054 __ push(a0); | 1054 __ push(a0); |
1055 | 1055 |
1056 // Check for proxies. | 1056 // Check for proxies. |
1057 Label call_runtime; | 1057 Label call_runtime; |
1058 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | |
1059 __ GetObjectType(a0, a1, a1); | 1058 __ GetObjectType(a0, a1, a1); |
1060 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE)); | 1059 __ Branch(&call_runtime, eq, a1, Operand(JS_PROXY_TYPE)); |
1061 | 1060 |
1062 // Check cache validity in generated code. This is a fast case for | 1061 // Check cache validity in generated code. This is a fast case for |
1063 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 1062 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
1064 // guarantee cache validity, call the runtime system to check cache | 1063 // guarantee cache validity, call the runtime system to check cache |
1065 // validity or get the property names in a fixed array. | 1064 // validity or get the property names in a fixed array. |
1066 __ CheckEnumCache(null_value, &call_runtime); | 1065 __ CheckEnumCache(null_value, &call_runtime); |
1067 | 1066 |
1068 // The enum cache is valid. Load the map of the object being | 1067 // The enum cache is valid. Load the map of the object being |
1069 // iterated over and use the cache for the iteration. | 1068 // iterated over and use the cache for the iteration. |
1070 Label use_cache; | 1069 Label use_cache; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 Label non_proxy; | 1109 Label non_proxy; |
1111 __ bind(&fixed_array); | 1110 __ bind(&fixed_array); |
1112 | 1111 |
1113 __ EmitLoadTypeFeedbackVector(a1); | 1112 __ EmitLoadTypeFeedbackVector(a1); |
1114 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1113 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1115 int vector_index = SmiFromSlot(slot)->value(); | 1114 int vector_index = SmiFromSlot(slot)->value(); |
1116 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); | 1115 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); |
1117 | 1116 |
1118 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check | 1117 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check |
1119 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | 1118 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object |
1120 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | 1119 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); |
1121 __ GetObjectType(a2, a3, a3); | 1120 __ GetObjectType(a2, a3, a3); |
1122 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); | 1121 __ Branch(&non_proxy, gt, a3, Operand(JS_PROXY_TYPE)); |
1123 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1122 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
1124 __ bind(&non_proxy); | 1123 __ bind(&non_proxy); |
1125 __ Push(a1, v0); // Smi and array | 1124 __ Push(a1, v0); // Smi and array |
1126 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); | 1125 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); |
1127 __ li(a0, Operand(Smi::FromInt(0))); | 1126 __ li(a0, Operand(Smi::FromInt(0))); |
1128 __ Push(a1, a0); // Fixed array length (as smi) and initial index. | 1127 __ Push(a1, a0); // Fixed array length (as smi) and initial index. |
1129 | 1128 |
1130 // Generate code for doing the condition check. | 1129 // Generate code for doing the condition check. |
1131 __ bind(&loop); | 1130 __ bind(&loop); |
1132 SetExpressionAsStatementPosition(stmt->each()); | 1131 SetExpressionAsStatementPosition(stmt->each()); |
(...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3257 VisitForAccumulatorValue(args->at(0)); | 3256 VisitForAccumulatorValue(args->at(0)); |
3258 | 3257 |
3259 Label materialize_true, materialize_false; | 3258 Label materialize_true, materialize_false; |
3260 Label* if_true = NULL; | 3259 Label* if_true = NULL; |
3261 Label* if_false = NULL; | 3260 Label* if_false = NULL; |
3262 Label* fall_through = NULL; | 3261 Label* fall_through = NULL; |
3263 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3262 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
3264 &if_false, &fall_through); | 3263 &if_false, &fall_through); |
3265 | 3264 |
3266 __ JumpIfSmi(v0, if_false); | 3265 __ JumpIfSmi(v0, if_false); |
3267 Register map = a1; | 3266 __ GetObjectType(v0, a1, a1); |
3268 Register type_reg = a2; | |
3269 __ GetObjectType(v0, map, type_reg); | |
3270 __ Subu(type_reg, type_reg, Operand(FIRST_JS_PROXY_TYPE)); | |
3271 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3267 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3272 Split(ls, type_reg, Operand(LAST_JS_PROXY_TYPE - FIRST_JS_PROXY_TYPE), | 3268 Split(eq, a1, Operand(JS_PROXY_TYPE), if_true, if_false, fall_through); |
3273 if_true, if_false, fall_through); | |
3274 | 3269 |
3275 context()->Plug(if_true, if_false); | 3270 context()->Plug(if_true, if_false); |
3276 } | 3271 } |
3277 | 3272 |
3278 | 3273 |
3279 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { | 3274 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { |
3280 ZoneList<Expression*>* args = expr->arguments(); | 3275 ZoneList<Expression*>* args = expr->arguments(); |
3281 DCHECK(args->length() == 2); | 3276 DCHECK(args->length() == 2); |
3282 | 3277 |
3283 // Load the two objects into registers and perform the comparison. | 3278 // Load the two objects into registers and perform the comparison. |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4938 reinterpret_cast<uint32_t>( | 4933 reinterpret_cast<uint32_t>( |
4939 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4934 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4940 return OSR_AFTER_STACK_CHECK; | 4935 return OSR_AFTER_STACK_CHECK; |
4941 } | 4936 } |
4942 | 4937 |
4943 | 4938 |
4944 } // namespace internal | 4939 } // namespace internal |
4945 } // namespace v8 | 4940 } // namespace v8 |
4946 | 4941 |
4947 #endif // V8_TARGET_ARCH_MIPS | 4942 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |