| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 6 | 6 |
| 7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
| 8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 // it to a JS receiver. See ECMA-262 version 5, section 12.6.4. | 1009 // it to a JS receiver. See ECMA-262 version 5, section 12.6.4. |
| 1010 Label convert, done_convert; | 1010 Label convert, done_convert; |
| 1011 __ JumpIfSmi(r0, &convert); | 1011 __ JumpIfSmi(r0, &convert); |
| 1012 __ CompareObjectType(r0, r1, r1, FIRST_JS_RECEIVER_TYPE); | 1012 __ CompareObjectType(r0, r1, r1, FIRST_JS_RECEIVER_TYPE); |
| 1013 __ b(ge, &done_convert); | 1013 __ b(ge, &done_convert); |
| 1014 __ CompareRoot(r0, Heap::kNullValueRootIndex); | 1014 __ CompareRoot(r0, Heap::kNullValueRootIndex); |
| 1015 __ b(eq, &exit); | 1015 __ b(eq, &exit); |
| 1016 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex); | 1016 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex); |
| 1017 __ b(eq, &exit); | 1017 __ b(eq, &exit); |
| 1018 __ bind(&convert); | 1018 __ bind(&convert); |
| 1019 ToObjectStub stub(isolate()); | 1019 __ Call(isolate()->builtins()->ToObject(), RelocInfo::CODE_TARGET); |
| 1020 __ CallStub(&stub); | |
| 1021 RestoreContext(); | 1020 RestoreContext(); |
| 1022 __ bind(&done_convert); | 1021 __ bind(&done_convert); |
| 1023 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); | 1022 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); |
| 1024 __ push(r0); | 1023 __ push(r0); |
| 1025 | 1024 |
| 1026 // Check cache validity in generated code. If we cannot guarantee cache | 1025 // Check cache validity in generated code. If we cannot guarantee cache |
| 1027 // validity, call the runtime system to check cache validity or get the | 1026 // validity, call the runtime system to check cache validity or get the |
| 1028 // property names in a fixed array. Note: Proxies never have an enum cache, | 1027 // property names in a fixed array. Note: Proxies never have an enum cache, |
| 1029 // so will always take the slow path. | 1028 // so will always take the slow path. |
| 1030 Label call_runtime; | 1029 Label call_runtime; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 __ cmp(r4, Operand(r2)); | 1110 __ cmp(r4, Operand(r2)); |
| 1112 __ b(eq, &update_each); | 1111 __ b(eq, &update_each); |
| 1113 | 1112 |
| 1114 // We need to filter the key, record slow-path here. | 1113 // We need to filter the key, record slow-path here. |
| 1115 int const vector_index = SmiFromSlot(slot)->value(); | 1114 int const vector_index = SmiFromSlot(slot)->value(); |
| 1116 __ EmitLoadTypeFeedbackVector(r3); | 1115 __ EmitLoadTypeFeedbackVector(r3); |
| 1117 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1116 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1118 __ str(r2, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index))); | 1117 __ str(r2, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index))); |
| 1119 | 1118 |
| 1120 // r0 contains the key. The receiver in r1 is the second argument to the | 1119 // r0 contains the key. The receiver in r1 is the second argument to the |
| 1121 // ForInFilterStub. ForInFilter returns undefined if the receiver doesn't | 1120 // ForInFilter. ForInFilter returns undefined if the receiver doesn't |
| 1122 // have the key or returns the name-converted key. | 1121 // have the key or returns the name-converted key. |
| 1123 ForInFilterStub filter_stub(isolate()); | 1122 __ Call(isolate()->builtins()->ForInFilter(), RelocInfo::CODE_TARGET); |
| 1124 __ CallStub(&filter_stub); | |
| 1125 RestoreContext(); | 1123 RestoreContext(); |
| 1126 PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER); | 1124 PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER); |
| 1127 __ CompareRoot(result_register(), Heap::kUndefinedValueRootIndex); | 1125 __ CompareRoot(result_register(), Heap::kUndefinedValueRootIndex); |
| 1128 __ b(eq, loop_statement.continue_label()); | 1126 __ b(eq, loop_statement.continue_label()); |
| 1129 | 1127 |
| 1130 // Update the 'each' property or variable from the possibly filtered | 1128 // Update the 'each' property or variable from the possibly filtered |
| 1131 // entry in register r0. | 1129 // entry in register r0. |
| 1132 __ bind(&update_each); | 1130 __ bind(&update_each); |
| 1133 | 1131 |
| 1134 // Perform the assignment as if via '='. | 1132 // Perform the assignment as if via '='. |
| (...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3043 break; | 3041 break; |
| 3044 } | 3042 } |
| 3045 | 3043 |
| 3046 case Token::TYPEOF: { | 3044 case Token::TYPEOF: { |
| 3047 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 3045 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
| 3048 { | 3046 { |
| 3049 AccumulatorValueContext context(this); | 3047 AccumulatorValueContext context(this); |
| 3050 VisitForTypeofValue(expr->expression()); | 3048 VisitForTypeofValue(expr->expression()); |
| 3051 } | 3049 } |
| 3052 __ mov(r3, r0); | 3050 __ mov(r3, r0); |
| 3053 TypeofStub typeof_stub(isolate()); | 3051 __ Call(isolate()->builtins()->Typeof(), RelocInfo::CODE_TARGET); |
| 3054 __ CallStub(&typeof_stub); | |
| 3055 context()->Plug(r0); | 3052 context()->Plug(r0); |
| 3056 break; | 3053 break; |
| 3057 } | 3054 } |
| 3058 | 3055 |
| 3059 default: | 3056 default: |
| 3060 UNREACHABLE(); | 3057 UNREACHABLE(); |
| 3061 } | 3058 } |
| 3062 } | 3059 } |
| 3063 | 3060 |
| 3064 | 3061 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3413 EmitHasProperty(); | 3410 EmitHasProperty(); |
| 3414 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3411 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 3415 __ CompareRoot(r0, Heap::kTrueValueRootIndex); | 3412 __ CompareRoot(r0, Heap::kTrueValueRootIndex); |
| 3416 Split(eq, if_true, if_false, fall_through); | 3413 Split(eq, if_true, if_false, fall_through); |
| 3417 break; | 3414 break; |
| 3418 | 3415 |
| 3419 case Token::INSTANCEOF: { | 3416 case Token::INSTANCEOF: { |
| 3420 VisitForAccumulatorValue(expr->right()); | 3417 VisitForAccumulatorValue(expr->right()); |
| 3421 SetExpressionPosition(expr); | 3418 SetExpressionPosition(expr); |
| 3422 PopOperand(r1); | 3419 PopOperand(r1); |
| 3423 InstanceOfStub stub(isolate()); | 3420 __ Call(isolate()->builtins()->InstanceOf(), RelocInfo::CODE_TARGET); |
| 3424 __ CallStub(&stub); | |
| 3425 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3421 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 3426 __ CompareRoot(r0, Heap::kTrueValueRootIndex); | 3422 __ CompareRoot(r0, Heap::kTrueValueRootIndex); |
| 3427 Split(eq, if_true, if_false, fall_through); | 3423 Split(eq, if_true, if_false, fall_through); |
| 3428 break; | 3424 break; |
| 3429 } | 3425 } |
| 3430 | 3426 |
| 3431 default: { | 3427 default: { |
| 3432 VisitForAccumulatorValue(expr->right()); | 3428 VisitForAccumulatorValue(expr->right()); |
| 3433 SetExpressionPosition(expr); | 3429 SetExpressionPosition(expr); |
| 3434 Condition cond = CompareIC::ComputeCondition(op); | 3430 Condition cond = CompareIC::ComputeCondition(op); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3736 DCHECK(interrupt_address == | 3732 DCHECK(interrupt_address == |
| 3737 isolate->builtins()->OnStackReplacement()->entry()); | 3733 isolate->builtins()->OnStackReplacement()->entry()); |
| 3738 return ON_STACK_REPLACEMENT; | 3734 return ON_STACK_REPLACEMENT; |
| 3739 } | 3735 } |
| 3740 | 3736 |
| 3741 | 3737 |
| 3742 } // namespace internal | 3738 } // namespace internal |
| 3743 } // namespace v8 | 3739 } // namespace v8 |
| 3744 | 3740 |
| 3745 #endif // V8_TARGET_ARCH_ARM | 3741 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |