| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 2810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2821 __ JumpIfSmi(r2, &done); | 2821 __ JumpIfSmi(r2, &done); |
| 2822 // If the object is not a value type, return the object. | 2822 // If the object is not a value type, return the object. |
| 2823 __ CompareObjectType(r2, r3, r3, JS_VALUE_TYPE); | 2823 __ CompareObjectType(r2, r3, r3, JS_VALUE_TYPE); |
| 2824 __ bne(&done, Label::kNear); | 2824 __ bne(&done, Label::kNear); |
| 2825 __ LoadP(r2, FieldMemOperand(r2, JSValue::kValueOffset)); | 2825 __ LoadP(r2, FieldMemOperand(r2, JSValue::kValueOffset)); |
| 2826 | 2826 |
| 2827 __ bind(&done); | 2827 __ bind(&done); |
| 2828 context()->Plug(r2); | 2828 context()->Plug(r2); |
| 2829 } | 2829 } |
| 2830 | 2830 |
| 2831 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { | |
| 2832 ZoneList<Expression*>* args = expr->arguments(); | |
| 2833 DCHECK_EQ(3, args->length()); | |
| 2834 | |
| 2835 Register string = r2; | |
| 2836 Register index = r3; | |
| 2837 Register value = r4; | |
| 2838 | |
| 2839 VisitForStackValue(args->at(0)); // index | |
| 2840 VisitForStackValue(args->at(1)); // value | |
| 2841 VisitForAccumulatorValue(args->at(2)); // string | |
| 2842 PopOperands(index, value); | |
| 2843 | |
| 2844 if (FLAG_debug_code) { | |
| 2845 __ TestIfSmi(value); | |
| 2846 __ Check(eq, kNonSmiValue, cr0); | |
| 2847 __ TestIfSmi(index); | |
| 2848 __ Check(eq, kNonSmiIndex, cr0); | |
| 2849 __ SmiUntag(index); | |
| 2850 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; | |
| 2851 __ EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type); | |
| 2852 __ SmiTag(index); | |
| 2853 } | |
| 2854 | |
| 2855 __ SmiUntag(value); | |
| 2856 __ AddP(ip, string, Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); | |
| 2857 __ SmiToByteArrayOffset(r1, index); | |
| 2858 __ StoreByte(value, MemOperand(ip, r1)); | |
| 2859 context()->Plug(string); | |
| 2860 } | |
| 2861 | |
| 2862 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) { | |
| 2863 ZoneList<Expression*>* args = expr->arguments(); | |
| 2864 DCHECK_EQ(3, args->length()); | |
| 2865 | |
| 2866 Register string = r2; | |
| 2867 Register index = r3; | |
| 2868 Register value = r4; | |
| 2869 | |
| 2870 VisitForStackValue(args->at(0)); // index | |
| 2871 VisitForStackValue(args->at(1)); // value | |
| 2872 VisitForAccumulatorValue(args->at(2)); // string | |
| 2873 PopOperands(index, value); | |
| 2874 | |
| 2875 if (FLAG_debug_code) { | |
| 2876 __ TestIfSmi(value); | |
| 2877 __ Check(eq, kNonSmiValue, cr0); | |
| 2878 __ TestIfSmi(index); | |
| 2879 __ Check(eq, kNonSmiIndex, cr0); | |
| 2880 __ SmiUntag(index, index); | |
| 2881 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; | |
| 2882 __ EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type); | |
| 2883 __ SmiTag(index, index); | |
| 2884 } | |
| 2885 | |
| 2886 __ SmiUntag(value); | |
| 2887 __ SmiToShortArrayOffset(r1, index); | |
| 2888 __ StoreHalfWord(value, MemOperand(r1, string, SeqTwoByteString::kHeaderSize - | |
| 2889 kHeapObjectTag)); | |
| 2890 context()->Plug(string); | |
| 2891 } | |
| 2892 | |
| 2893 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | 2831 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
| 2894 ZoneList<Expression*>* args = expr->arguments(); | 2832 ZoneList<Expression*>* args = expr->arguments(); |
| 2895 DCHECK(args->length() == 1); | 2833 DCHECK(args->length() == 1); |
| 2896 VisitForAccumulatorValue(args->at(0)); | 2834 VisitForAccumulatorValue(args->at(0)); |
| 2897 | 2835 |
| 2898 Label done; | 2836 Label done; |
| 2899 StringCharFromCodeGenerator generator(r2, r3); | 2837 StringCharFromCodeGenerator generator(r2, r3); |
| 2900 generator.GenerateFast(masm_); | 2838 generator.GenerateFast(masm_); |
| 2901 __ b(&done); | 2839 __ b(&done); |
| 2902 | 2840 |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3778 DCHECK(kOSRBranchInstruction == br_instr); | 3716 DCHECK(kOSRBranchInstruction == br_instr); |
| 3779 | 3717 |
| 3780 DCHECK(interrupt_address == | 3718 DCHECK(interrupt_address == |
| 3781 isolate->builtins()->OnStackReplacement()->entry()); | 3719 isolate->builtins()->OnStackReplacement()->entry()); |
| 3782 return ON_STACK_REPLACEMENT; | 3720 return ON_STACK_REPLACEMENT; |
| 3783 } | 3721 } |
| 3784 | 3722 |
| 3785 } // namespace internal | 3723 } // namespace internal |
| 3786 } // namespace v8 | 3724 } // namespace v8 |
| 3787 #endif // V8_TARGET_ARCH_S390 | 3725 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |