OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 // it to a JS receiver. See ECMA-262 version 5, section 12.6.4. | 939 // it to a JS receiver. See ECMA-262 version 5, section 12.6.4. |
940 Label convert, done_convert; | 940 Label convert, done_convert; |
941 __ JumpIfSmi(r2, &convert); | 941 __ JumpIfSmi(r2, &convert); |
942 __ CompareObjectType(r2, r3, r3, FIRST_JS_RECEIVER_TYPE); | 942 __ CompareObjectType(r2, r3, r3, FIRST_JS_RECEIVER_TYPE); |
943 __ bge(&done_convert); | 943 __ bge(&done_convert); |
944 __ CompareRoot(r2, Heap::kNullValueRootIndex); | 944 __ CompareRoot(r2, Heap::kNullValueRootIndex); |
945 __ beq(&exit); | 945 __ beq(&exit); |
946 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); | 946 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); |
947 __ beq(&exit); | 947 __ beq(&exit); |
948 __ bind(&convert); | 948 __ bind(&convert); |
949 ToObjectStub stub(isolate()); | 949 __ Call(isolate()->builtins()->ToObject(), RelocInfo::CODE_TARGET); |
950 __ CallStub(&stub); | |
951 RestoreContext(); | 950 RestoreContext(); |
952 __ bind(&done_convert); | 951 __ bind(&done_convert); |
953 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); | 952 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); |
954 __ push(r2); | 953 __ push(r2); |
955 | 954 |
956 // Check cache validity in generated code. If we cannot guarantee cache | 955 // Check cache validity in generated code. If we cannot guarantee cache |
957 // validity, call the runtime system to check cache validity or get the | 956 // validity, call the runtime system to check cache validity or get the |
958 // property names in a fixed array. Note: Proxies never have an enum cache, | 957 // property names in a fixed array. Note: Proxies never have an enum cache, |
959 // so will always take the slow path. | 958 // so will always take the slow path. |
960 Label call_runtime; | 959 Label call_runtime; |
(...skipping 2002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 break; | 2962 break; |
2964 } | 2963 } |
2965 | 2964 |
2966 case Token::TYPEOF: { | 2965 case Token::TYPEOF: { |
2967 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 2966 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
2968 { | 2967 { |
2969 AccumulatorValueContext context(this); | 2968 AccumulatorValueContext context(this); |
2970 VisitForTypeofValue(expr->expression()); | 2969 VisitForTypeofValue(expr->expression()); |
2971 } | 2970 } |
2972 __ LoadRR(r5, r2); | 2971 __ LoadRR(r5, r2); |
2973 TypeofStub typeof_stub(isolate()); | 2972 __ Call(isolate()->builtins()->Typeof(), RelocInfo::CODE_TARGET); |
2974 __ CallStub(&typeof_stub); | |
2975 context()->Plug(r2); | 2973 context()->Plug(r2); |
2976 break; | 2974 break; |
2977 } | 2975 } |
2978 | 2976 |
2979 default: | 2977 default: |
2980 UNREACHABLE(); | 2978 UNREACHABLE(); |
2981 } | 2979 } |
2982 } | 2980 } |
2983 | 2981 |
2984 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { | 2982 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3328 EmitHasProperty(); | 3326 EmitHasProperty(); |
3329 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3327 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3330 __ CompareRoot(r2, Heap::kTrueValueRootIndex); | 3328 __ CompareRoot(r2, Heap::kTrueValueRootIndex); |
3331 Split(eq, if_true, if_false, fall_through); | 3329 Split(eq, if_true, if_false, fall_through); |
3332 break; | 3330 break; |
3333 | 3331 |
3334 case Token::INSTANCEOF: { | 3332 case Token::INSTANCEOF: { |
3335 VisitForAccumulatorValue(expr->right()); | 3333 VisitForAccumulatorValue(expr->right()); |
3336 SetExpressionPosition(expr); | 3334 SetExpressionPosition(expr); |
3337 PopOperand(r3); | 3335 PopOperand(r3); |
3338 InstanceOfStub stub(isolate()); | 3336 __ Call(isolate()->builtins()->InstanceOf(), RelocInfo::CODE_TARGET); |
3339 __ CallStub(&stub); | |
3340 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3337 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3341 __ CompareRoot(r2, Heap::kTrueValueRootIndex); | 3338 __ CompareRoot(r2, Heap::kTrueValueRootIndex); |
3342 Split(eq, if_true, if_false, fall_through); | 3339 Split(eq, if_true, if_false, fall_through); |
3343 break; | 3340 break; |
3344 } | 3341 } |
3345 | 3342 |
3346 default: { | 3343 default: { |
3347 VisitForAccumulatorValue(expr->right()); | 3344 VisitForAccumulatorValue(expr->right()); |
3348 SetExpressionPosition(expr); | 3345 SetExpressionPosition(expr); |
3349 Condition cond = CompareIC::ComputeCondition(op); | 3346 Condition cond = CompareIC::ComputeCondition(op); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3574 DCHECK(kOSRBranchInstruction == br_instr); | 3571 DCHECK(kOSRBranchInstruction == br_instr); |
3575 | 3572 |
3576 DCHECK(interrupt_address == | 3573 DCHECK(interrupt_address == |
3577 isolate->builtins()->OnStackReplacement()->entry()); | 3574 isolate->builtins()->OnStackReplacement()->entry()); |
3578 return ON_STACK_REPLACEMENT; | 3575 return ON_STACK_REPLACEMENT; |
3579 } | 3576 } |
3580 | 3577 |
3581 } // namespace internal | 3578 } // namespace internal |
3582 } // namespace v8 | 3579 } // namespace v8 |
3583 #endif // V8_TARGET_ARCH_S390 | 3580 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |