| 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 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 __ cmp(r1, r0); | 1073 __ cmp(r1, r0); |
| 1074 __ b(ne, &next_test); | 1074 __ b(ne, &next_test); |
| 1075 __ Drop(1); // Switch value is no longer needed. | 1075 __ Drop(1); // Switch value is no longer needed. |
| 1076 __ b(clause->body_target()); | 1076 __ b(clause->body_target()); |
| 1077 __ bind(&slow_case); | 1077 __ bind(&slow_case); |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 // Record position before stub call for type feedback. | 1080 // Record position before stub call for type feedback. |
| 1081 SetSourcePosition(clause->position()); | 1081 SetSourcePosition(clause->position()); |
| 1082 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1082 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
| 1083 language_mode()).code(); | 1083 strength(language_mode())).code(); |
| 1084 CallIC(ic, clause->CompareId()); | 1084 CallIC(ic, clause->CompareId()); |
| 1085 patch_site.EmitPatchInfo(); | 1085 patch_site.EmitPatchInfo(); |
| 1086 | 1086 |
| 1087 Label skip; | 1087 Label skip; |
| 1088 __ b(&skip); | 1088 __ b(&skip); |
| 1089 PrepareForBailout(clause, TOS_REG); | 1089 PrepareForBailout(clause, TOS_REG); |
| 1090 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 1090 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 1091 __ cmp(r0, ip); | 1091 __ cmp(r0, ip); |
| 1092 __ b(ne, &next_test); | 1092 __ b(ne, &next_test); |
| 1093 __ Drop(1); | 1093 __ Drop(1); |
| (...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2473 Register right = r0; | 2473 Register right = r0; |
| 2474 __ pop(left); | 2474 __ pop(left); |
| 2475 | 2475 |
| 2476 // Perform combined smi check on both operands. | 2476 // Perform combined smi check on both operands. |
| 2477 __ orr(scratch1, left, Operand(right)); | 2477 __ orr(scratch1, left, Operand(right)); |
| 2478 STATIC_ASSERT(kSmiTag == 0); | 2478 STATIC_ASSERT(kSmiTag == 0); |
| 2479 JumpPatchSite patch_site(masm_); | 2479 JumpPatchSite patch_site(masm_); |
| 2480 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2480 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
| 2481 | 2481 |
| 2482 __ bind(&stub_call); | 2482 __ bind(&stub_call); |
| 2483 Handle<Code> code = CodeFactory::BinaryOpIC( | 2483 Handle<Code> code = |
| 2484 isolate(), op, language_mode()).code(); | 2484 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2485 CallIC(code, expr->BinaryOperationFeedbackId()); | 2485 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2486 patch_site.EmitPatchInfo(); | 2486 patch_site.EmitPatchInfo(); |
| 2487 __ jmp(&done); | 2487 __ jmp(&done); |
| 2488 | 2488 |
| 2489 __ bind(&smi_case); | 2489 __ bind(&smi_case); |
| 2490 // Smi case. This code works the same way as the smi-smi case in the type | 2490 // Smi case. This code works the same way as the smi-smi case in the type |
| 2491 // recording binary operation stub, see | 2491 // recording binary operation stub, see |
| 2492 switch (op) { | 2492 switch (op) { |
| 2493 case Token::SAR: | 2493 case Token::SAR: |
| 2494 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2494 __ GetLeastBitsFromSmi(scratch1, right, 5); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 // prototype | 2618 // prototype |
| 2619 __ CallRuntime(Runtime::kToFastProperties, 1); | 2619 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2620 | 2620 |
| 2621 // constructor | 2621 // constructor |
| 2622 __ CallRuntime(Runtime::kToFastProperties, 1); | 2622 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2623 } | 2623 } |
| 2624 | 2624 |
| 2625 | 2625 |
| 2626 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2626 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2627 __ pop(r1); | 2627 __ pop(r1); |
| 2628 Handle<Code> code = CodeFactory::BinaryOpIC( | 2628 Handle<Code> code = |
| 2629 isolate(), op, language_mode()).code(); | 2629 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2630 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2630 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2631 CallIC(code, expr->BinaryOperationFeedbackId()); | 2631 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2632 patch_site.EmitPatchInfo(); | 2632 patch_site.EmitPatchInfo(); |
| 2633 context()->Plug(r0); | 2633 context()->Plug(r0); |
| 2634 } | 2634 } |
| 2635 | 2635 |
| 2636 | 2636 |
| 2637 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2637 void FullCodeGenerator::EmitAssignment(Expression* expr, |
| 2638 FeedbackVectorICSlot slot) { | 2638 FeedbackVectorICSlot slot) { |
| 2639 DCHECK(expr->IsValidReferenceExpression()); | 2639 DCHECK(expr->IsValidReferenceExpression()); |
| (...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5028 } | 5028 } |
| 5029 | 5029 |
| 5030 | 5030 |
| 5031 __ bind(&stub_call); | 5031 __ bind(&stub_call); |
| 5032 __ mov(r1, r0); | 5032 __ mov(r1, r0); |
| 5033 __ mov(r0, Operand(Smi::FromInt(count_value))); | 5033 __ mov(r0, Operand(Smi::FromInt(count_value))); |
| 5034 | 5034 |
| 5035 // Record position before stub call. | 5035 // Record position before stub call. |
| 5036 SetSourcePosition(expr->position()); | 5036 SetSourcePosition(expr->position()); |
| 5037 | 5037 |
| 5038 Handle<Code> code = CodeFactory::BinaryOpIC( | 5038 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
| 5039 isolate(), Token::ADD, language_mode()).code(); | 5039 strength(language_mode())).code(); |
| 5040 CallIC(code, expr->CountBinOpFeedbackId()); | 5040 CallIC(code, expr->CountBinOpFeedbackId()); |
| 5041 patch_site.EmitPatchInfo(); | 5041 patch_site.EmitPatchInfo(); |
| 5042 __ bind(&done); | 5042 __ bind(&done); |
| 5043 | 5043 |
| 5044 // Store the value returned in r0. | 5044 // Store the value returned in r0. |
| 5045 switch (assign_type) { | 5045 switch (assign_type) { |
| 5046 case VARIABLE: | 5046 case VARIABLE: |
| 5047 if (expr->is_postfix()) { | 5047 if (expr->is_postfix()) { |
| 5048 { EffectContext context(this); | 5048 { EffectContext context(this); |
| 5049 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5049 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5295 Label slow_case; | 5295 Label slow_case; |
| 5296 __ orr(r2, r0, Operand(r1)); | 5296 __ orr(r2, r0, Operand(r1)); |
| 5297 patch_site.EmitJumpIfNotSmi(r2, &slow_case); | 5297 patch_site.EmitJumpIfNotSmi(r2, &slow_case); |
| 5298 __ cmp(r1, r0); | 5298 __ cmp(r1, r0); |
| 5299 Split(cond, if_true, if_false, NULL); | 5299 Split(cond, if_true, if_false, NULL); |
| 5300 __ bind(&slow_case); | 5300 __ bind(&slow_case); |
| 5301 } | 5301 } |
| 5302 | 5302 |
| 5303 // Record position and call the compare IC. | 5303 // Record position and call the compare IC. |
| 5304 SetSourcePosition(expr->position()); | 5304 SetSourcePosition(expr->position()); |
| 5305 Handle<Code> ic = | 5305 Handle<Code> ic = CodeFactory::CompareIC( |
| 5306 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5306 isolate(), op, strength(language_mode())).code(); |
| 5307 CallIC(ic, expr->CompareOperationFeedbackId()); | 5307 CallIC(ic, expr->CompareOperationFeedbackId()); |
| 5308 patch_site.EmitPatchInfo(); | 5308 patch_site.EmitPatchInfo(); |
| 5309 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5309 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 5310 __ cmp(r0, Operand::Zero()); | 5310 __ cmp(r0, Operand::Zero()); |
| 5311 Split(cond, if_true, if_false, fall_through); | 5311 Split(cond, if_true, if_false, fall_through); |
| 5312 } | 5312 } |
| 5313 } | 5313 } |
| 5314 | 5314 |
| 5315 // Convert the result of the comparison into one expected for this | 5315 // Convert the result of the comparison into one expected for this |
| 5316 // expression's context. | 5316 // expression's context. |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5596 DCHECK(interrupt_address == | 5596 DCHECK(interrupt_address == |
| 5597 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5597 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5598 return OSR_AFTER_STACK_CHECK; | 5598 return OSR_AFTER_STACK_CHECK; |
| 5599 } | 5599 } |
| 5600 | 5600 |
| 5601 | 5601 |
| 5602 } // namespace internal | 5602 } // namespace internal |
| 5603 } // namespace v8 | 5603 } // namespace v8 |
| 5604 | 5604 |
| 5605 #endif // V8_TARGET_ARCH_ARM | 5605 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |