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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 __ Cmp(x1, x0); | 1067 __ Cmp(x1, x0); |
1068 __ B(ne, &next_test); | 1068 __ B(ne, &next_test); |
1069 __ Drop(1); // Switch value is no longer needed. | 1069 __ Drop(1); // Switch value is no longer needed. |
1070 __ B(clause->body_target()); | 1070 __ B(clause->body_target()); |
1071 __ Bind(&slow_case); | 1071 __ Bind(&slow_case); |
1072 } | 1072 } |
1073 | 1073 |
1074 // Record position before stub call for type feedback. | 1074 // Record position before stub call for type feedback. |
1075 SetSourcePosition(clause->position()); | 1075 SetSourcePosition(clause->position()); |
1076 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1076 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
1077 language_mode()).code(); | 1077 strength(language_mode())).code(); |
1078 CallIC(ic, clause->CompareId()); | 1078 CallIC(ic, clause->CompareId()); |
1079 patch_site.EmitPatchInfo(); | 1079 patch_site.EmitPatchInfo(); |
1080 | 1080 |
1081 Label skip; | 1081 Label skip; |
1082 __ B(&skip); | 1082 __ B(&skip); |
1083 PrepareForBailout(clause, TOS_REG); | 1083 PrepareForBailout(clause, TOS_REG); |
1084 __ JumpIfNotRoot(x0, Heap::kTrueValueRootIndex, &next_test); | 1084 __ JumpIfNotRoot(x0, Heap::kTrueValueRootIndex, &next_test); |
1085 __ Drop(1); | 1085 __ Drop(1); |
1086 __ B(clause->body_target()); | 1086 __ B(clause->body_target()); |
1087 __ Bind(&skip); | 1087 __ Bind(&skip); |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2141 Register result = x0; | 2141 Register result = x0; |
2142 __ Pop(left); | 2142 __ Pop(left); |
2143 | 2143 |
2144 // Perform combined smi check on both operands. | 2144 // Perform combined smi check on both operands. |
2145 __ Orr(x10, left, right); | 2145 __ Orr(x10, left, right); |
2146 JumpPatchSite patch_site(masm_); | 2146 JumpPatchSite patch_site(masm_); |
2147 patch_site.EmitJumpIfSmi(x10, &both_smis); | 2147 patch_site.EmitJumpIfSmi(x10, &both_smis); |
2148 | 2148 |
2149 __ Bind(&stub_call); | 2149 __ Bind(&stub_call); |
2150 | 2150 |
2151 Handle<Code> code = CodeFactory::BinaryOpIC( | 2151 Handle<Code> code = |
2152 isolate(), op, language_mode()).code(); | 2152 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2153 { | 2153 { |
2154 Assembler::BlockPoolsScope scope(masm_); | 2154 Assembler::BlockPoolsScope scope(masm_); |
2155 CallIC(code, expr->BinaryOperationFeedbackId()); | 2155 CallIC(code, expr->BinaryOperationFeedbackId()); |
2156 patch_site.EmitPatchInfo(); | 2156 patch_site.EmitPatchInfo(); |
2157 } | 2157 } |
2158 __ B(&done); | 2158 __ B(&done); |
2159 | 2159 |
2160 __ Bind(&both_smis); | 2160 __ Bind(&both_smis); |
2161 // Smi case. This code works in the same way as the smi-smi case in the type | 2161 // Smi case. This code works in the same way as the smi-smi case in the type |
2162 // recording binary operation stub, see | 2162 // recording binary operation stub, see |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2224 UNREACHABLE(); | 2224 UNREACHABLE(); |
2225 } | 2225 } |
2226 | 2226 |
2227 __ Bind(&done); | 2227 __ Bind(&done); |
2228 context()->Plug(x0); | 2228 context()->Plug(x0); |
2229 } | 2229 } |
2230 | 2230 |
2231 | 2231 |
2232 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2232 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2233 __ Pop(x1); | 2233 __ Pop(x1); |
2234 Handle<Code> code = CodeFactory::BinaryOpIC( | 2234 Handle<Code> code = |
2235 isolate(), op, language_mode()).code(); | 2235 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2236 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. | 2236 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. |
2237 { | 2237 { |
2238 Assembler::BlockPoolsScope scope(masm_); | 2238 Assembler::BlockPoolsScope scope(masm_); |
2239 CallIC(code, expr->BinaryOperationFeedbackId()); | 2239 CallIC(code, expr->BinaryOperationFeedbackId()); |
2240 patch_site.EmitPatchInfo(); | 2240 patch_site.EmitPatchInfo(); |
2241 } | 2241 } |
2242 context()->Plug(x0); | 2242 context()->Plug(x0); |
2243 } | 2243 } |
2244 | 2244 |
2245 | 2245 |
(...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4715 | 4715 |
4716 __ Bind(&stub_call); | 4716 __ Bind(&stub_call); |
4717 __ Mov(x1, x0); | 4717 __ Mov(x1, x0); |
4718 __ Mov(x0, Smi::FromInt(count_value)); | 4718 __ Mov(x0, Smi::FromInt(count_value)); |
4719 | 4719 |
4720 // Record position before stub call. | 4720 // Record position before stub call. |
4721 SetSourcePosition(expr->position()); | 4721 SetSourcePosition(expr->position()); |
4722 | 4722 |
4723 { | 4723 { |
4724 Assembler::BlockPoolsScope scope(masm_); | 4724 Assembler::BlockPoolsScope scope(masm_); |
4725 Handle<Code> code = CodeFactory::BinaryOpIC( | 4725 Handle<Code> code = |
4726 isolate(), Token::ADD, language_mode()).code(); | 4726 CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
| 4727 strength(language_mode())).code(); |
4727 CallIC(code, expr->CountBinOpFeedbackId()); | 4728 CallIC(code, expr->CountBinOpFeedbackId()); |
4728 patch_site.EmitPatchInfo(); | 4729 patch_site.EmitPatchInfo(); |
4729 } | 4730 } |
4730 __ Bind(&done); | 4731 __ Bind(&done); |
4731 | 4732 |
4732 // Store the value returned in x0. | 4733 // Store the value returned in x0. |
4733 switch (assign_type) { | 4734 switch (assign_type) { |
4734 case VARIABLE: | 4735 case VARIABLE: |
4735 if (expr->is_postfix()) { | 4736 if (expr->is_postfix()) { |
4736 { EffectContext context(this); | 4737 { EffectContext context(this); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4991 if (ShouldInlineSmiCase(op)) { | 4992 if (ShouldInlineSmiCase(op)) { |
4992 Label slow_case; | 4993 Label slow_case; |
4993 patch_site.EmitJumpIfEitherNotSmi(x0, x1, &slow_case); | 4994 patch_site.EmitJumpIfEitherNotSmi(x0, x1, &slow_case); |
4994 __ Cmp(x1, x0); | 4995 __ Cmp(x1, x0); |
4995 Split(cond, if_true, if_false, NULL); | 4996 Split(cond, if_true, if_false, NULL); |
4996 __ Bind(&slow_case); | 4997 __ Bind(&slow_case); |
4997 } | 4998 } |
4998 | 4999 |
4999 // Record position and call the compare IC. | 5000 // Record position and call the compare IC. |
5000 SetSourcePosition(expr->position()); | 5001 SetSourcePosition(expr->position()); |
5001 Handle<Code> ic = | 5002 Handle<Code> ic = CodeFactory::CompareIC( |
5002 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5003 isolate(), op, strength(language_mode())).code(); |
5003 CallIC(ic, expr->CompareOperationFeedbackId()); | 5004 CallIC(ic, expr->CompareOperationFeedbackId()); |
5004 patch_site.EmitPatchInfo(); | 5005 patch_site.EmitPatchInfo(); |
5005 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5006 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
5006 __ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through); | 5007 __ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through); |
5007 } | 5008 } |
5008 } | 5009 } |
5009 | 5010 |
5010 // Convert the result of the comparison into one expected for this | 5011 // Convert the result of the comparison into one expected for this |
5011 // expression's context. | 5012 // expression's context. |
5012 context()->Plug(if_true, if_false); | 5013 context()->Plug(if_true, if_false); |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5570 } | 5571 } |
5571 | 5572 |
5572 return INTERRUPT; | 5573 return INTERRUPT; |
5573 } | 5574 } |
5574 | 5575 |
5575 | 5576 |
5576 } // namespace internal | 5577 } // namespace internal |
5577 } // namespace v8 | 5578 } // namespace v8 |
5578 | 5579 |
5579 #endif // V8_TARGET_ARCH_ARM64 | 5580 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |