| 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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 Label convert, done_convert; | 1005 Label convert, done_convert; |
| 1006 __ JumpIfSmi(a0, &convert); | 1006 __ JumpIfSmi(a0, &convert); |
| 1007 __ GetObjectType(a0, a1, a1); | 1007 __ GetObjectType(a0, a1, a1); |
| 1008 __ Branch(USE_DELAY_SLOT, &done_convert, ge, a1, | 1008 __ Branch(USE_DELAY_SLOT, &done_convert, ge, a1, |
| 1009 Operand(FIRST_JS_RECEIVER_TYPE)); | 1009 Operand(FIRST_JS_RECEIVER_TYPE)); |
| 1010 __ LoadRoot(at, Heap::kNullValueRootIndex); // In delay slot. | 1010 __ LoadRoot(at, Heap::kNullValueRootIndex); // In delay slot. |
| 1011 __ Branch(USE_DELAY_SLOT, &exit, eq, a0, Operand(at)); | 1011 __ Branch(USE_DELAY_SLOT, &exit, eq, a0, Operand(at)); |
| 1012 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); // In delay slot. | 1012 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); // In delay slot. |
| 1013 __ Branch(&exit, eq, a0, Operand(at)); | 1013 __ Branch(&exit, eq, a0, Operand(at)); |
| 1014 __ bind(&convert); | 1014 __ bind(&convert); |
| 1015 ToObjectStub stub(isolate()); | 1015 __ Call(isolate()->builtins()->ToObject(), RelocInfo::CODE_TARGET); |
| 1016 __ CallStub(&stub); | |
| 1017 RestoreContext(); | 1016 RestoreContext(); |
| 1018 __ mov(a0, v0); | 1017 __ mov(a0, v0); |
| 1019 __ bind(&done_convert); | 1018 __ bind(&done_convert); |
| 1020 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); | 1019 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); |
| 1021 __ push(a0); | 1020 __ push(a0); |
| 1022 | 1021 |
| 1023 // Check cache validity in generated code. If we cannot guarantee cache | 1022 // Check cache validity in generated code. If we cannot guarantee cache |
| 1024 // validity, call the runtime system to check cache validity or get the | 1023 // validity, call the runtime system to check cache validity or get the |
| 1025 // property names in a fixed array. Note: Proxies never have an enum cache, | 1024 // property names in a fixed array. Note: Proxies never have an enum cache, |
| 1026 // so will always take the slow path. | 1025 // so will always take the slow path. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 __ Branch(&update_each, eq, t0, Operand(a2)); | 1105 __ Branch(&update_each, eq, t0, Operand(a2)); |
| 1107 | 1106 |
| 1108 // We need to filter the key, record slow-path here. | 1107 // We need to filter the key, record slow-path here. |
| 1109 int const vector_index = SmiFromSlot(slot)->value(); | 1108 int const vector_index = SmiFromSlot(slot)->value(); |
| 1110 __ EmitLoadTypeFeedbackVector(a3); | 1109 __ EmitLoadTypeFeedbackVector(a3); |
| 1111 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1110 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1112 __ sw(a2, FieldMemOperand(a3, FixedArray::OffsetOfElementAt(vector_index))); | 1111 __ sw(a2, FieldMemOperand(a3, FixedArray::OffsetOfElementAt(vector_index))); |
| 1113 | 1112 |
| 1114 __ mov(a0, result_register()); | 1113 __ mov(a0, result_register()); |
| 1115 // a0 contains the key. The receiver in a1 is the second argument to the | 1114 // a0 contains the key. The receiver in a1 is the second argument to the |
| 1116 // ForInFilterStub. ForInFilter returns undefined if the receiver doesn't | 1115 // ForInFilter. ForInFilter returns undefined if the receiver doesn't |
| 1117 // have the key or returns the name-converted key. | 1116 // have the key or returns the name-converted key. |
| 1118 ForInFilterStub filter_stub(isolate()); | 1117 __ Call(isolate()->builtins()->ForInFilter(), RelocInfo::CODE_TARGET); |
| 1119 __ CallStub(&filter_stub); | |
| 1120 RestoreContext(); | 1118 RestoreContext(); |
| 1121 PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER); | 1119 PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER); |
| 1122 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 1120 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 1123 __ Branch(loop_statement.continue_label(), eq, result_register(), | 1121 __ Branch(loop_statement.continue_label(), eq, result_register(), |
| 1124 Operand(at)); | 1122 Operand(at)); |
| 1125 | 1123 |
| 1126 // Update the 'each' property or variable from the possibly filtered | 1124 // Update the 'each' property or variable from the possibly filtered |
| 1127 // entry in the result_register. | 1125 // entry in the result_register. |
| 1128 __ bind(&update_each); | 1126 __ bind(&update_each); |
| 1129 // Perform the assignment as if via '='. | 1127 // Perform the assignment as if via '='. |
| (...skipping 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3050 break; | 3048 break; |
| 3051 } | 3049 } |
| 3052 | 3050 |
| 3053 case Token::TYPEOF: { | 3051 case Token::TYPEOF: { |
| 3054 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 3052 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
| 3055 { | 3053 { |
| 3056 AccumulatorValueContext context(this); | 3054 AccumulatorValueContext context(this); |
| 3057 VisitForTypeofValue(expr->expression()); | 3055 VisitForTypeofValue(expr->expression()); |
| 3058 } | 3056 } |
| 3059 __ mov(a3, v0); | 3057 __ mov(a3, v0); |
| 3060 TypeofStub typeof_stub(isolate()); | 3058 __ Call(isolate()->builtins()->Typeof(), RelocInfo::CODE_TARGET); |
| 3061 __ CallStub(&typeof_stub); | |
| 3062 context()->Plug(v0); | 3059 context()->Plug(v0); |
| 3063 break; | 3060 break; |
| 3064 } | 3061 } |
| 3065 | 3062 |
| 3066 default: | 3063 default: |
| 3067 UNREACHABLE(); | 3064 UNREACHABLE(); |
| 3068 } | 3065 } |
| 3069 } | 3066 } |
| 3070 | 3067 |
| 3071 | 3068 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3420 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3417 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 3421 __ LoadRoot(t0, Heap::kTrueValueRootIndex); | 3418 __ LoadRoot(t0, Heap::kTrueValueRootIndex); |
| 3422 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); | 3419 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); |
| 3423 break; | 3420 break; |
| 3424 | 3421 |
| 3425 case Token::INSTANCEOF: { | 3422 case Token::INSTANCEOF: { |
| 3426 VisitForAccumulatorValue(expr->right()); | 3423 VisitForAccumulatorValue(expr->right()); |
| 3427 SetExpressionPosition(expr); | 3424 SetExpressionPosition(expr); |
| 3428 __ mov(a0, result_register()); | 3425 __ mov(a0, result_register()); |
| 3429 PopOperand(a1); | 3426 PopOperand(a1); |
| 3430 InstanceOfStub stub(isolate()); | 3427 __ Call(isolate()->builtins()->InstanceOf(), RelocInfo::CODE_TARGET); |
| 3431 __ CallStub(&stub); | |
| 3432 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3428 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 3433 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 3429 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
| 3434 Split(eq, v0, Operand(at), if_true, if_false, fall_through); | 3430 Split(eq, v0, Operand(at), if_true, if_false, fall_through); |
| 3435 break; | 3431 break; |
| 3436 } | 3432 } |
| 3437 | 3433 |
| 3438 default: { | 3434 default: { |
| 3439 VisitForAccumulatorValue(expr->right()); | 3435 VisitForAccumulatorValue(expr->right()); |
| 3440 SetExpressionPosition(expr); | 3436 SetExpressionPosition(expr); |
| 3441 Condition cc = CompareIC::ComputeCondition(op); | 3437 Condition cc = CompareIC::ComputeCondition(op); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3676 reinterpret_cast<uint32_t>( | 3672 reinterpret_cast<uint32_t>( |
| 3677 isolate->builtins()->OnStackReplacement()->entry())); | 3673 isolate->builtins()->OnStackReplacement()->entry())); |
| 3678 return ON_STACK_REPLACEMENT; | 3674 return ON_STACK_REPLACEMENT; |
| 3679 } | 3675 } |
| 3680 | 3676 |
| 3681 | 3677 |
| 3682 } // namespace internal | 3678 } // namespace internal |
| 3683 } // namespace v8 | 3679 } // namespace v8 |
| 3684 | 3680 |
| 3685 #endif // V8_TARGET_ARCH_MIPS | 3681 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |