| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 __ bind(&convert); | 1033 __ bind(&convert); |
| 1034 ToObjectStub stub(isolate()); | 1034 ToObjectStub stub(isolate()); |
| 1035 __ CallStub(&stub); | 1035 __ CallStub(&stub); |
| 1036 __ mov(a0, v0); | 1036 __ mov(a0, v0); |
| 1037 __ bind(&done_convert); | 1037 __ bind(&done_convert); |
| 1038 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); | 1038 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
| 1039 __ push(a0); | 1039 __ push(a0); |
| 1040 | 1040 |
| 1041 // Check for proxies. | 1041 // Check for proxies. |
| 1042 Label call_runtime; | 1042 Label call_runtime; |
| 1043 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | |
| 1044 __ GetObjectType(a0, a1, a1); | 1043 __ GetObjectType(a0, a1, a1); |
| 1045 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE)); | 1044 __ Branch(&call_runtime, eq, a1, Operand(JS_PROXY_TYPE)); |
| 1046 | 1045 |
| 1047 // Check cache validity in generated code. This is a fast case for | 1046 // Check cache validity in generated code. This is a fast case for |
| 1048 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 1047 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
| 1049 // guarantee cache validity, call the runtime system to check cache | 1048 // guarantee cache validity, call the runtime system to check cache |
| 1050 // validity or get the property names in a fixed array. | 1049 // validity or get the property names in a fixed array. |
| 1051 __ CheckEnumCache(null_value, &call_runtime); | 1050 __ CheckEnumCache(null_value, &call_runtime); |
| 1052 | 1051 |
| 1053 // The enum cache is valid. Load the map of the object being | 1052 // The enum cache is valid. Load the map of the object being |
| 1054 // iterated over and use the cache for the iteration. | 1053 // iterated over and use the cache for the iteration. |
| 1055 Label use_cache; | 1054 Label use_cache; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 Label non_proxy; | 1094 Label non_proxy; |
| 1096 __ bind(&fixed_array); | 1095 __ bind(&fixed_array); |
| 1097 | 1096 |
| 1098 __ EmitLoadTypeFeedbackVector(a1); | 1097 __ EmitLoadTypeFeedbackVector(a1); |
| 1099 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1098 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1100 int vector_index = SmiFromSlot(slot)->value(); | 1099 int vector_index = SmiFromSlot(slot)->value(); |
| 1101 __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); | 1100 __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); |
| 1102 | 1101 |
| 1103 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check | 1102 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check |
| 1104 __ ld(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | 1103 __ ld(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object |
| 1105 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | 1104 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); |
| 1106 __ GetObjectType(a2, a3, a3); | 1105 __ GetObjectType(a2, a3, a3); |
| 1107 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); | 1106 __ Branch(&non_proxy, gt, a3, Operand(JS_PROXY_TYPE)); |
| 1108 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1107 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
| 1109 __ bind(&non_proxy); | 1108 __ bind(&non_proxy); |
| 1110 __ Push(a1, v0); // Smi and array | 1109 __ Push(a1, v0); // Smi and array |
| 1111 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); | 1110 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); |
| 1112 __ li(a0, Operand(Smi::FromInt(0))); | 1111 __ li(a0, Operand(Smi::FromInt(0))); |
| 1113 __ Push(a1, a0); // Fixed array length (as smi) and initial index. | 1112 __ Push(a1, a0); // Fixed array length (as smi) and initial index. |
| 1114 | 1113 |
| 1115 // Generate code for doing the condition check. | 1114 // Generate code for doing the condition check. |
| 1116 __ bind(&loop); | 1115 __ bind(&loop); |
| 1117 SetExpressionAsStatementPosition(stmt->each()); | 1116 SetExpressionAsStatementPosition(stmt->each()); |
| (...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3247 VisitForAccumulatorValue(args->at(0)); | 3246 VisitForAccumulatorValue(args->at(0)); |
| 3248 | 3247 |
| 3249 Label materialize_true, materialize_false; | 3248 Label materialize_true, materialize_false; |
| 3250 Label* if_true = NULL; | 3249 Label* if_true = NULL; |
| 3251 Label* if_false = NULL; | 3250 Label* if_false = NULL; |
| 3252 Label* fall_through = NULL; | 3251 Label* fall_through = NULL; |
| 3253 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3252 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3254 &if_false, &fall_through); | 3253 &if_false, &fall_through); |
| 3255 | 3254 |
| 3256 __ JumpIfSmi(v0, if_false); | 3255 __ JumpIfSmi(v0, if_false); |
| 3257 Register map = a1; | 3256 __ GetObjectType(v0, a1, a1); |
| 3258 Register type_reg = a2; | |
| 3259 __ GetObjectType(v0, map, type_reg); | |
| 3260 __ Subu(type_reg, type_reg, Operand(FIRST_JS_PROXY_TYPE)); | |
| 3261 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3257 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3262 Split(ls, type_reg, Operand(LAST_JS_PROXY_TYPE - FIRST_JS_PROXY_TYPE), | 3258 Split(eq, a1, Operand(JS_PROXY_TYPE), if_true, if_false, fall_through); |
| 3263 if_true, if_false, fall_through); | |
| 3264 | 3259 |
| 3265 context()->Plug(if_true, if_false); | 3260 context()->Plug(if_true, if_false); |
| 3266 } | 3261 } |
| 3267 | 3262 |
| 3268 | 3263 |
| 3269 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { | 3264 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { |
| 3270 ZoneList<Expression*>* args = expr->arguments(); | 3265 ZoneList<Expression*>* args = expr->arguments(); |
| 3271 DCHECK(args->length() == 2); | 3266 DCHECK(args->length() == 2); |
| 3272 | 3267 |
| 3273 // Load the two objects into registers and perform the comparison. | 3268 // Load the two objects into registers and perform the comparison. |
| (...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4932 reinterpret_cast<uint64_t>( | 4927 reinterpret_cast<uint64_t>( |
| 4933 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4928 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4934 return OSR_AFTER_STACK_CHECK; | 4929 return OSR_AFTER_STACK_CHECK; |
| 4935 } | 4930 } |
| 4936 | 4931 |
| 4937 | 4932 |
| 4938 } // namespace internal | 4933 } // namespace internal |
| 4939 } // namespace v8 | 4934 } // namespace v8 |
| 4940 | 4935 |
| 4941 #endif // V8_TARGET_ARCH_MIPS64 | 4936 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |