| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 __ cmp(r1, r0); | 1090 __ cmp(r1, r0); |
| 1091 __ b(ne, &next_test); | 1091 __ b(ne, &next_test); |
| 1092 __ Drop(1); // Switch value is no longer needed. | 1092 __ Drop(1); // Switch value is no longer needed. |
| 1093 __ b(clause->body_target()); | 1093 __ b(clause->body_target()); |
| 1094 __ bind(&slow_case); | 1094 __ bind(&slow_case); |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 // Record position before stub call for type feedback. | 1097 // Record position before stub call for type feedback. |
| 1098 SetSourcePosition(clause->position()); | 1098 SetSourcePosition(clause->position()); |
| 1099 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1099 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
| 1100 language_mode()).code(); | 1100 strength(language_mode())).code(); |
| 1101 CallIC(ic, clause->CompareId()); | 1101 CallIC(ic, clause->CompareId()); |
| 1102 patch_site.EmitPatchInfo(); | 1102 patch_site.EmitPatchInfo(); |
| 1103 | 1103 |
| 1104 Label skip; | 1104 Label skip; |
| 1105 __ b(&skip); | 1105 __ b(&skip); |
| 1106 PrepareForBailout(clause, TOS_REG); | 1106 PrepareForBailout(clause, TOS_REG); |
| 1107 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 1107 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 1108 __ cmp(r0, ip); | 1108 __ cmp(r0, ip); |
| 1109 __ b(ne, &next_test); | 1109 __ b(ne, &next_test); |
| 1110 __ Drop(1); | 1110 __ Drop(1); |
| (...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 Register right = r0; | 2491 Register right = r0; |
| 2492 __ pop(left); | 2492 __ pop(left); |
| 2493 | 2493 |
| 2494 // Perform combined smi check on both operands. | 2494 // Perform combined smi check on both operands. |
| 2495 __ orr(scratch1, left, Operand(right)); | 2495 __ orr(scratch1, left, Operand(right)); |
| 2496 STATIC_ASSERT(kSmiTag == 0); | 2496 STATIC_ASSERT(kSmiTag == 0); |
| 2497 JumpPatchSite patch_site(masm_); | 2497 JumpPatchSite patch_site(masm_); |
| 2498 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2498 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
| 2499 | 2499 |
| 2500 __ bind(&stub_call); | 2500 __ bind(&stub_call); |
| 2501 Handle<Code> code = CodeFactory::BinaryOpIC( | 2501 Handle<Code> code = |
| 2502 isolate(), op, language_mode()).code(); | 2502 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2503 CallIC(code, expr->BinaryOperationFeedbackId()); | 2503 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2504 patch_site.EmitPatchInfo(); | 2504 patch_site.EmitPatchInfo(); |
| 2505 __ jmp(&done); | 2505 __ jmp(&done); |
| 2506 | 2506 |
| 2507 __ bind(&smi_case); | 2507 __ bind(&smi_case); |
| 2508 // Smi case. This code works the same way as the smi-smi case in the type | 2508 // Smi case. This code works the same way as the smi-smi case in the type |
| 2509 // recording binary operation stub, see | 2509 // recording binary operation stub, see |
| 2510 switch (op) { | 2510 switch (op) { |
| 2511 case Token::SAR: | 2511 case Token::SAR: |
| 2512 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2512 __ GetLeastBitsFromSmi(scratch1, right, 5); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 // prototype | 2636 // prototype |
| 2637 __ CallRuntime(Runtime::kToFastProperties, 1); | 2637 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2638 | 2638 |
| 2639 // constructor | 2639 // constructor |
| 2640 __ CallRuntime(Runtime::kToFastProperties, 1); | 2640 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2641 } | 2641 } |
| 2642 | 2642 |
| 2643 | 2643 |
| 2644 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2644 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2645 __ pop(r1); | 2645 __ pop(r1); |
| 2646 Handle<Code> code = CodeFactory::BinaryOpIC( | 2646 Handle<Code> code = |
| 2647 isolate(), op, language_mode()).code(); | 2647 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2648 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2648 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2649 CallIC(code, expr->BinaryOperationFeedbackId()); | 2649 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2650 patch_site.EmitPatchInfo(); | 2650 patch_site.EmitPatchInfo(); |
| 2651 context()->Plug(r0); | 2651 context()->Plug(r0); |
| 2652 } | 2652 } |
| 2653 | 2653 |
| 2654 | 2654 |
| 2655 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2655 void FullCodeGenerator::EmitAssignment(Expression* expr, |
| 2656 FeedbackVectorICSlot slot) { | 2656 FeedbackVectorICSlot slot) { |
| 2657 DCHECK(expr->IsValidReferenceExpression()); | 2657 DCHECK(expr->IsValidReferenceExpression()); |
| (...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5046 } | 5046 } |
| 5047 | 5047 |
| 5048 | 5048 |
| 5049 __ bind(&stub_call); | 5049 __ bind(&stub_call); |
| 5050 __ mov(r1, r0); | 5050 __ mov(r1, r0); |
| 5051 __ mov(r0, Operand(Smi::FromInt(count_value))); | 5051 __ mov(r0, Operand(Smi::FromInt(count_value))); |
| 5052 | 5052 |
| 5053 // Record position before stub call. | 5053 // Record position before stub call. |
| 5054 SetSourcePosition(expr->position()); | 5054 SetSourcePosition(expr->position()); |
| 5055 | 5055 |
| 5056 Handle<Code> code = CodeFactory::BinaryOpIC( | 5056 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
| 5057 isolate(), Token::ADD, language_mode()).code(); | 5057 strength(language_mode())).code(); |
| 5058 CallIC(code, expr->CountBinOpFeedbackId()); | 5058 CallIC(code, expr->CountBinOpFeedbackId()); |
| 5059 patch_site.EmitPatchInfo(); | 5059 patch_site.EmitPatchInfo(); |
| 5060 __ bind(&done); | 5060 __ bind(&done); |
| 5061 | 5061 |
| 5062 // Store the value returned in r0. | 5062 // Store the value returned in r0. |
| 5063 switch (assign_type) { | 5063 switch (assign_type) { |
| 5064 case VARIABLE: | 5064 case VARIABLE: |
| 5065 if (expr->is_postfix()) { | 5065 if (expr->is_postfix()) { |
| 5066 { EffectContext context(this); | 5066 { EffectContext context(this); |
| 5067 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5067 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5313 Label slow_case; | 5313 Label slow_case; |
| 5314 __ orr(r2, r0, Operand(r1)); | 5314 __ orr(r2, r0, Operand(r1)); |
| 5315 patch_site.EmitJumpIfNotSmi(r2, &slow_case); | 5315 patch_site.EmitJumpIfNotSmi(r2, &slow_case); |
| 5316 __ cmp(r1, r0); | 5316 __ cmp(r1, r0); |
| 5317 Split(cond, if_true, if_false, NULL); | 5317 Split(cond, if_true, if_false, NULL); |
| 5318 __ bind(&slow_case); | 5318 __ bind(&slow_case); |
| 5319 } | 5319 } |
| 5320 | 5320 |
| 5321 // Record position and call the compare IC. | 5321 // Record position and call the compare IC. |
| 5322 SetSourcePosition(expr->position()); | 5322 SetSourcePosition(expr->position()); |
| 5323 Handle<Code> ic = | 5323 Handle<Code> ic = CodeFactory::CompareIC( |
| 5324 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5324 isolate(), op, strength(language_mode())).code(); |
| 5325 CallIC(ic, expr->CompareOperationFeedbackId()); | 5325 CallIC(ic, expr->CompareOperationFeedbackId()); |
| 5326 patch_site.EmitPatchInfo(); | 5326 patch_site.EmitPatchInfo(); |
| 5327 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5327 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 5328 __ cmp(r0, Operand::Zero()); | 5328 __ cmp(r0, Operand::Zero()); |
| 5329 Split(cond, if_true, if_false, fall_through); | 5329 Split(cond, if_true, if_false, fall_through); |
| 5330 } | 5330 } |
| 5331 } | 5331 } |
| 5332 | 5332 |
| 5333 // Convert the result of the comparison into one expected for this | 5333 // Convert the result of the comparison into one expected for this |
| 5334 // expression's context. | 5334 // expression's context. |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5614 DCHECK(interrupt_address == | 5614 DCHECK(interrupt_address == |
| 5615 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5615 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5616 return OSR_AFTER_STACK_CHECK; | 5616 return OSR_AFTER_STACK_CHECK; |
| 5617 } | 5617 } |
| 5618 | 5618 |
| 5619 | 5619 |
| 5620 } // namespace internal | 5620 } // namespace internal |
| 5621 } // namespace v8 | 5621 } // namespace v8 |
| 5622 | 5622 |
| 5623 #endif // V8_TARGET_ARCH_ARM | 5623 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |