OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 patch_site.EmitJumpIfEitherNotSmi(x0, x1, &slow_case); | 966 patch_site.EmitJumpIfEitherNotSmi(x0, x1, &slow_case); |
967 __ Cmp(x1, x0); | 967 __ Cmp(x1, x0); |
968 __ B(ne, &next_test); | 968 __ B(ne, &next_test); |
969 __ Drop(1); // Switch value is no longer needed. | 969 __ Drop(1); // Switch value is no longer needed. |
970 __ B(clause->body_target()); | 970 __ B(clause->body_target()); |
971 __ Bind(&slow_case); | 971 __ Bind(&slow_case); |
972 } | 972 } |
973 | 973 |
974 // Record position before stub call for type feedback. | 974 // Record position before stub call for type feedback. |
975 SetExpressionPosition(clause); | 975 SetExpressionPosition(clause); |
976 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 976 Handle<Code> ic = |
977 strength(language_mode())).code(); | 977 CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); |
978 CallIC(ic, clause->CompareId()); | 978 CallIC(ic, clause->CompareId()); |
979 patch_site.EmitPatchInfo(); | 979 patch_site.EmitPatchInfo(); |
980 | 980 |
981 Label skip; | 981 Label skip; |
982 __ B(&skip); | 982 __ B(&skip); |
983 PrepareForBailout(clause, TOS_REG); | 983 PrepareForBailout(clause, TOS_REG); |
984 __ JumpIfNotRoot(x0, Heap::kTrueValueRootIndex, &next_test); | 984 __ JumpIfNotRoot(x0, Heap::kTrueValueRootIndex, &next_test); |
985 __ Drop(1); | 985 __ Drop(1); |
986 __ B(clause->body_target()); | 986 __ B(clause->body_target()); |
987 __ Bind(&skip); | 987 __ Bind(&skip); |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1939 Register result = x0; | 1939 Register result = x0; |
1940 __ Pop(left); | 1940 __ Pop(left); |
1941 | 1941 |
1942 // Perform combined smi check on both operands. | 1942 // Perform combined smi check on both operands. |
1943 __ Orr(x10, left, right); | 1943 __ Orr(x10, left, right); |
1944 JumpPatchSite patch_site(masm_); | 1944 JumpPatchSite patch_site(masm_); |
1945 patch_site.EmitJumpIfSmi(x10, &both_smis); | 1945 patch_site.EmitJumpIfSmi(x10, &both_smis); |
1946 | 1946 |
1947 __ Bind(&stub_call); | 1947 __ Bind(&stub_call); |
1948 | 1948 |
1949 Handle<Code> code = | 1949 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
1950 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | |
1951 { | 1950 { |
1952 Assembler::BlockPoolsScope scope(masm_); | 1951 Assembler::BlockPoolsScope scope(masm_); |
1953 CallIC(code, expr->BinaryOperationFeedbackId()); | 1952 CallIC(code, expr->BinaryOperationFeedbackId()); |
1954 patch_site.EmitPatchInfo(); | 1953 patch_site.EmitPatchInfo(); |
1955 } | 1954 } |
1956 __ B(&done); | 1955 __ B(&done); |
1957 | 1956 |
1958 __ Bind(&both_smis); | 1957 __ Bind(&both_smis); |
1959 // Smi case. This code works in the same way as the smi-smi case in the type | 1958 // Smi case. This code works in the same way as the smi-smi case in the type |
1960 // recording binary operation stub, see | 1959 // recording binary operation stub, see |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 UNREACHABLE(); | 2021 UNREACHABLE(); |
2023 } | 2022 } |
2024 | 2023 |
2025 __ Bind(&done); | 2024 __ Bind(&done); |
2026 context()->Plug(x0); | 2025 context()->Plug(x0); |
2027 } | 2026 } |
2028 | 2027 |
2029 | 2028 |
2030 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2029 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2031 __ Pop(x1); | 2030 __ Pop(x1); |
2032 Handle<Code> code = | 2031 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
2033 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | |
2034 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. | 2032 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. |
2035 { | 2033 { |
2036 Assembler::BlockPoolsScope scope(masm_); | 2034 Assembler::BlockPoolsScope scope(masm_); |
2037 CallIC(code, expr->BinaryOperationFeedbackId()); | 2035 CallIC(code, expr->BinaryOperationFeedbackId()); |
2038 patch_site.EmitPatchInfo(); | 2036 patch_site.EmitPatchInfo(); |
2039 } | 2037 } |
2040 context()->Plug(x0); | 2038 context()->Plug(x0); |
2041 } | 2039 } |
2042 | 2040 |
2043 | 2041 |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3907 } | 3905 } |
3908 | 3906 |
3909 __ Bind(&stub_call); | 3907 __ Bind(&stub_call); |
3910 __ Mov(x1, x0); | 3908 __ Mov(x1, x0); |
3911 __ Mov(x0, Smi::FromInt(count_value)); | 3909 __ Mov(x0, Smi::FromInt(count_value)); |
3912 | 3910 |
3913 SetExpressionPosition(expr); | 3911 SetExpressionPosition(expr); |
3914 | 3912 |
3915 { | 3913 { |
3916 Assembler::BlockPoolsScope scope(masm_); | 3914 Assembler::BlockPoolsScope scope(masm_); |
3917 Handle<Code> code = | 3915 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); |
3918 CodeFactory::BinaryOpIC(isolate(), Token::ADD, | |
3919 strength(language_mode())).code(); | |
3920 CallIC(code, expr->CountBinOpFeedbackId()); | 3916 CallIC(code, expr->CountBinOpFeedbackId()); |
3921 patch_site.EmitPatchInfo(); | 3917 patch_site.EmitPatchInfo(); |
3922 } | 3918 } |
3923 __ Bind(&done); | 3919 __ Bind(&done); |
3924 | 3920 |
3925 if (is_strong(language_mode())) { | 3921 if (is_strong(language_mode())) { |
3926 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 3922 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
3927 } | 3923 } |
3928 // Store the value returned in x0. | 3924 // Store the value returned in x0. |
3929 switch (assign_type) { | 3925 switch (assign_type) { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4144 | 4140 |
4145 JumpPatchSite patch_site(masm_); | 4141 JumpPatchSite patch_site(masm_); |
4146 if (ShouldInlineSmiCase(op)) { | 4142 if (ShouldInlineSmiCase(op)) { |
4147 Label slow_case; | 4143 Label slow_case; |
4148 patch_site.EmitJumpIfEitherNotSmi(x0, x1, &slow_case); | 4144 patch_site.EmitJumpIfEitherNotSmi(x0, x1, &slow_case); |
4149 __ Cmp(x1, x0); | 4145 __ Cmp(x1, x0); |
4150 Split(cond, if_true, if_false, NULL); | 4146 Split(cond, if_true, if_false, NULL); |
4151 __ Bind(&slow_case); | 4147 __ Bind(&slow_case); |
4152 } | 4148 } |
4153 | 4149 |
4154 Handle<Code> ic = CodeFactory::CompareIC( | 4150 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); |
4155 isolate(), op, strength(language_mode())).code(); | |
4156 CallIC(ic, expr->CompareOperationFeedbackId()); | 4151 CallIC(ic, expr->CompareOperationFeedbackId()); |
4157 patch_site.EmitPatchInfo(); | 4152 patch_site.EmitPatchInfo(); |
4158 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4153 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
4159 __ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through); | 4154 __ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through); |
4160 } | 4155 } |
4161 } | 4156 } |
4162 | 4157 |
4163 // Convert the result of the comparison into one expected for this | 4158 // Convert the result of the comparison into one expected for this |
4164 // expression's context. | 4159 // expression's context. |
4165 context()->Plug(if_true, if_false); | 4160 context()->Plug(if_true, if_false); |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4623 } | 4618 } |
4624 | 4619 |
4625 return INTERRUPT; | 4620 return INTERRUPT; |
4626 } | 4621 } |
4627 | 4622 |
4628 | 4623 |
4629 } // namespace internal | 4624 } // namespace internal |
4630 } // namespace v8 | 4625 } // namespace v8 |
4631 | 4626 |
4632 #endif // V8_TARGET_ARCH_ARM64 | 4627 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |