| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 __ Cmp(x1, x0); | 1085 __ Cmp(x1, x0); |
| 1086 __ B(ne, &next_test); | 1086 __ B(ne, &next_test); |
| 1087 __ Drop(1); // Switch value is no longer needed. | 1087 __ Drop(1); // Switch value is no longer needed. |
| 1088 __ B(clause->body_target()); | 1088 __ B(clause->body_target()); |
| 1089 __ Bind(&slow_case); | 1089 __ Bind(&slow_case); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 // Record position before stub call for type feedback. | 1092 // Record position before stub call for type feedback. |
| 1093 SetSourcePosition(clause->position()); | 1093 SetSourcePosition(clause->position()); |
| 1094 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1094 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
| 1095 language_mode()).code(); | 1095 strength(language_mode())).code(); |
| 1096 CallIC(ic, clause->CompareId()); | 1096 CallIC(ic, clause->CompareId()); |
| 1097 patch_site.EmitPatchInfo(); | 1097 patch_site.EmitPatchInfo(); |
| 1098 | 1098 |
| 1099 Label skip; | 1099 Label skip; |
| 1100 __ B(&skip); | 1100 __ B(&skip); |
| 1101 PrepareForBailout(clause, TOS_REG); | 1101 PrepareForBailout(clause, TOS_REG); |
| 1102 __ JumpIfNotRoot(x0, Heap::kTrueValueRootIndex, &next_test); | 1102 __ JumpIfNotRoot(x0, Heap::kTrueValueRootIndex, &next_test); |
| 1103 __ Drop(1); | 1103 __ Drop(1); |
| 1104 __ B(clause->body_target()); | 1104 __ B(clause->body_target()); |
| 1105 __ Bind(&skip); | 1105 __ Bind(&skip); |
| (...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 Register result = x0; | 2159 Register result = x0; |
| 2160 __ Pop(left); | 2160 __ Pop(left); |
| 2161 | 2161 |
| 2162 // Perform combined smi check on both operands. | 2162 // Perform combined smi check on both operands. |
| 2163 __ Orr(x10, left, right); | 2163 __ Orr(x10, left, right); |
| 2164 JumpPatchSite patch_site(masm_); | 2164 JumpPatchSite patch_site(masm_); |
| 2165 patch_site.EmitJumpIfSmi(x10, &both_smis); | 2165 patch_site.EmitJumpIfSmi(x10, &both_smis); |
| 2166 | 2166 |
| 2167 __ Bind(&stub_call); | 2167 __ Bind(&stub_call); |
| 2168 | 2168 |
| 2169 Handle<Code> code = CodeFactory::BinaryOpIC( | 2169 Handle<Code> code = |
| 2170 isolate(), op, language_mode()).code(); | 2170 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2171 { | 2171 { |
| 2172 Assembler::BlockPoolsScope scope(masm_); | 2172 Assembler::BlockPoolsScope scope(masm_); |
| 2173 CallIC(code, expr->BinaryOperationFeedbackId()); | 2173 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2174 patch_site.EmitPatchInfo(); | 2174 patch_site.EmitPatchInfo(); |
| 2175 } | 2175 } |
| 2176 __ B(&done); | 2176 __ B(&done); |
| 2177 | 2177 |
| 2178 __ Bind(&both_smis); | 2178 __ Bind(&both_smis); |
| 2179 // Smi case. This code works in the same way as the smi-smi case in the type | 2179 // Smi case. This code works in the same way as the smi-smi case in the type |
| 2180 // recording binary operation stub, see | 2180 // recording binary operation stub, see |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2242 UNREACHABLE(); | 2242 UNREACHABLE(); |
| 2243 } | 2243 } |
| 2244 | 2244 |
| 2245 __ Bind(&done); | 2245 __ Bind(&done); |
| 2246 context()->Plug(x0); | 2246 context()->Plug(x0); |
| 2247 } | 2247 } |
| 2248 | 2248 |
| 2249 | 2249 |
| 2250 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2250 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2251 __ Pop(x1); | 2251 __ Pop(x1); |
| 2252 Handle<Code> code = CodeFactory::BinaryOpIC( | 2252 Handle<Code> code = |
| 2253 isolate(), op, language_mode()).code(); | 2253 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2254 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. | 2254 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. |
| 2255 { | 2255 { |
| 2256 Assembler::BlockPoolsScope scope(masm_); | 2256 Assembler::BlockPoolsScope scope(masm_); |
| 2257 CallIC(code, expr->BinaryOperationFeedbackId()); | 2257 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2258 patch_site.EmitPatchInfo(); | 2258 patch_site.EmitPatchInfo(); |
| 2259 } | 2259 } |
| 2260 context()->Plug(x0); | 2260 context()->Plug(x0); |
| 2261 } | 2261 } |
| 2262 | 2262 |
| 2263 | 2263 |
| (...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4724 | 4724 |
| 4725 __ Bind(&stub_call); | 4725 __ Bind(&stub_call); |
| 4726 __ Mov(x1, x0); | 4726 __ Mov(x1, x0); |
| 4727 __ Mov(x0, Smi::FromInt(count_value)); | 4727 __ Mov(x0, Smi::FromInt(count_value)); |
| 4728 | 4728 |
| 4729 // Record position before stub call. | 4729 // Record position before stub call. |
| 4730 SetSourcePosition(expr->position()); | 4730 SetSourcePosition(expr->position()); |
| 4731 | 4731 |
| 4732 { | 4732 { |
| 4733 Assembler::BlockPoolsScope scope(masm_); | 4733 Assembler::BlockPoolsScope scope(masm_); |
| 4734 Handle<Code> code = CodeFactory::BinaryOpIC( | 4734 Handle<Code> code = |
| 4735 isolate(), Token::ADD, language_mode()).code(); | 4735 CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
| 4736 strength(language_mode())).code(); |
| 4736 CallIC(code, expr->CountBinOpFeedbackId()); | 4737 CallIC(code, expr->CountBinOpFeedbackId()); |
| 4737 patch_site.EmitPatchInfo(); | 4738 patch_site.EmitPatchInfo(); |
| 4738 } | 4739 } |
| 4739 __ Bind(&done); | 4740 __ Bind(&done); |
| 4740 | 4741 |
| 4741 // Store the value returned in x0. | 4742 // Store the value returned in x0. |
| 4742 switch (assign_type) { | 4743 switch (assign_type) { |
| 4743 case VARIABLE: | 4744 case VARIABLE: |
| 4744 if (expr->is_postfix()) { | 4745 if (expr->is_postfix()) { |
| 4745 { EffectContext context(this); | 4746 { EffectContext context(this); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5000 if (ShouldInlineSmiCase(op)) { | 5001 if (ShouldInlineSmiCase(op)) { |
| 5001 Label slow_case; | 5002 Label slow_case; |
| 5002 patch_site.EmitJumpIfEitherNotSmi(x0, x1, &slow_case); | 5003 patch_site.EmitJumpIfEitherNotSmi(x0, x1, &slow_case); |
| 5003 __ Cmp(x1, x0); | 5004 __ Cmp(x1, x0); |
| 5004 Split(cond, if_true, if_false, NULL); | 5005 Split(cond, if_true, if_false, NULL); |
| 5005 __ Bind(&slow_case); | 5006 __ Bind(&slow_case); |
| 5006 } | 5007 } |
| 5007 | 5008 |
| 5008 // Record position and call the compare IC. | 5009 // Record position and call the compare IC. |
| 5009 SetSourcePosition(expr->position()); | 5010 SetSourcePosition(expr->position()); |
| 5010 Handle<Code> ic = | 5011 Handle<Code> ic = CodeFactory::CompareIC( |
| 5011 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5012 isolate(), op, strength(language_mode())).code(); |
| 5012 CallIC(ic, expr->CompareOperationFeedbackId()); | 5013 CallIC(ic, expr->CompareOperationFeedbackId()); |
| 5013 patch_site.EmitPatchInfo(); | 5014 patch_site.EmitPatchInfo(); |
| 5014 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5015 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 5015 __ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through); | 5016 __ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through); |
| 5016 } | 5017 } |
| 5017 } | 5018 } |
| 5018 | 5019 |
| 5019 // Convert the result of the comparison into one expected for this | 5020 // Convert the result of the comparison into one expected for this |
| 5020 // expression's context. | 5021 // expression's context. |
| 5021 context()->Plug(if_true, if_false); | 5022 context()->Plug(if_true, if_false); |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5579 } | 5580 } |
| 5580 | 5581 |
| 5581 return INTERRUPT; | 5582 return INTERRUPT; |
| 5582 } | 5583 } |
| 5583 | 5584 |
| 5584 | 5585 |
| 5585 } // namespace internal | 5586 } // namespace internal |
| 5586 } // namespace v8 | 5587 } // namespace v8 |
| 5587 | 5588 |
| 5588 #endif // V8_TARGET_ARCH_ARM64 | 5589 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |