OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 __ cmp(r4, r3); | 1035 __ cmp(r4, r3); |
1036 __ bne(&next_test); | 1036 __ bne(&next_test); |
1037 __ Drop(1); // Switch value is no longer needed. | 1037 __ Drop(1); // Switch value is no longer needed. |
1038 __ b(clause->body_target()); | 1038 __ b(clause->body_target()); |
1039 __ bind(&slow_case); | 1039 __ bind(&slow_case); |
1040 } | 1040 } |
1041 | 1041 |
1042 // Record position before stub call for type feedback. | 1042 // Record position before stub call for type feedback. |
1043 SetSourcePosition(clause->position()); | 1043 SetSourcePosition(clause->position()); |
1044 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1044 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
1045 language_mode()).code(); | 1045 strength(language_mode())).code(); |
1046 CallIC(ic, clause->CompareId()); | 1046 CallIC(ic, clause->CompareId()); |
1047 patch_site.EmitPatchInfo(); | 1047 patch_site.EmitPatchInfo(); |
1048 | 1048 |
1049 Label skip; | 1049 Label skip; |
1050 __ b(&skip); | 1050 __ b(&skip); |
1051 PrepareForBailout(clause, TOS_REG); | 1051 PrepareForBailout(clause, TOS_REG); |
1052 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 1052 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
1053 __ cmp(r3, ip); | 1053 __ cmp(r3, ip); |
1054 __ bne(&next_test); | 1054 __ bne(&next_test); |
1055 __ Drop(1); | 1055 __ Drop(1); |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2439 Register right = r3; | 2439 Register right = r3; |
2440 __ pop(left); | 2440 __ pop(left); |
2441 | 2441 |
2442 // Perform combined smi check on both operands. | 2442 // Perform combined smi check on both operands. |
2443 __ orx(scratch1, left, right); | 2443 __ orx(scratch1, left, right); |
2444 STATIC_ASSERT(kSmiTag == 0); | 2444 STATIC_ASSERT(kSmiTag == 0); |
2445 JumpPatchSite patch_site(masm_); | 2445 JumpPatchSite patch_site(masm_); |
2446 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2446 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
2447 | 2447 |
2448 __ bind(&stub_call); | 2448 __ bind(&stub_call); |
2449 Handle<Code> code = CodeFactory::BinaryOpIC( | 2449 Handle<Code> code = |
2450 isolate(), op, language_mode()).code(); | 2450 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2451 CallIC(code, expr->BinaryOperationFeedbackId()); | 2451 CallIC(code, expr->BinaryOperationFeedbackId()); |
2452 patch_site.EmitPatchInfo(); | 2452 patch_site.EmitPatchInfo(); |
2453 __ b(&done); | 2453 __ b(&done); |
2454 | 2454 |
2455 __ bind(&smi_case); | 2455 __ bind(&smi_case); |
2456 // Smi case. This code works the same way as the smi-smi case in the type | 2456 // Smi case. This code works the same way as the smi-smi case in the type |
2457 // recording binary operation stub. | 2457 // recording binary operation stub. |
2458 switch (op) { | 2458 switch (op) { |
2459 case Token::SAR: | 2459 case Token::SAR: |
2460 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2460 __ GetLeastBitsFromSmi(scratch1, right, 5); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2616 // prototype | 2616 // prototype |
2617 __ CallRuntime(Runtime::kToFastProperties, 1); | 2617 __ CallRuntime(Runtime::kToFastProperties, 1); |
2618 | 2618 |
2619 // constructor | 2619 // constructor |
2620 __ CallRuntime(Runtime::kToFastProperties, 1); | 2620 __ CallRuntime(Runtime::kToFastProperties, 1); |
2621 } | 2621 } |
2622 | 2622 |
2623 | 2623 |
2624 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2624 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2625 __ pop(r4); | 2625 __ pop(r4); |
2626 Handle<Code> code = CodeFactory::BinaryOpIC( | 2626 Handle<Code> code = |
2627 isolate(), op, language_mode()).code(); | 2627 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2628 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2628 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2629 CallIC(code, expr->BinaryOperationFeedbackId()); | 2629 CallIC(code, expr->BinaryOperationFeedbackId()); |
2630 patch_site.EmitPatchInfo(); | 2630 patch_site.EmitPatchInfo(); |
2631 context()->Plug(r3); | 2631 context()->Plug(r3); |
2632 } | 2632 } |
2633 | 2633 |
2634 | 2634 |
2635 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2635 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2636 FeedbackVectorICSlot slot) { | 2636 FeedbackVectorICSlot slot) { |
2637 DCHECK(expr->IsValidReferenceExpression()); | 2637 DCHECK(expr->IsValidReferenceExpression()); |
(...skipping 2408 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 __ mr(r4, r3); | 5050 __ mr(r4, r3); |
5051 __ LoadSmiLiteral(r3, Smi::FromInt(count_value)); | 5051 __ LoadSmiLiteral(r3, 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 r3. | 5062 // Store the value returned in r3. |
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 { | 5066 { |
5067 EffectContext context(this); | 5067 EffectContext context(this); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5316 Label slow_case; | 5316 Label slow_case; |
5317 __ orx(r5, r3, r4); | 5317 __ orx(r5, r3, r4); |
5318 patch_site.EmitJumpIfNotSmi(r5, &slow_case); | 5318 patch_site.EmitJumpIfNotSmi(r5, &slow_case); |
5319 __ cmp(r4, r3); | 5319 __ cmp(r4, r3); |
5320 Split(cond, if_true, if_false, NULL); | 5320 Split(cond, if_true, if_false, NULL); |
5321 __ bind(&slow_case); | 5321 __ bind(&slow_case); |
5322 } | 5322 } |
5323 | 5323 |
5324 // Record position and call the compare IC. | 5324 // Record position and call the compare IC. |
5325 SetSourcePosition(expr->position()); | 5325 SetSourcePosition(expr->position()); |
5326 Handle<Code> ic = | 5326 Handle<Code> ic = CodeFactory::CompareIC( |
5327 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5327 isolate(), op, strength(language_mode())).code(); |
5328 CallIC(ic, expr->CompareOperationFeedbackId()); | 5328 CallIC(ic, expr->CompareOperationFeedbackId()); |
5329 patch_site.EmitPatchInfo(); | 5329 patch_site.EmitPatchInfo(); |
5330 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5330 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
5331 __ cmpi(r3, Operand::Zero()); | 5331 __ cmpi(r3, Operand::Zero()); |
5332 Split(cond, if_true, if_false, fall_through); | 5332 Split(cond, if_true, if_false, fall_through); |
5333 } | 5333 } |
5334 } | 5334 } |
5335 | 5335 |
5336 // Convert the result of the comparison into one expected for this | 5336 // Convert the result of the comparison into one expected for this |
5337 // expression's context. | 5337 // expression's context. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5546 return ON_STACK_REPLACEMENT; | 5546 return ON_STACK_REPLACEMENT; |
5547 } | 5547 } |
5548 | 5548 |
5549 DCHECK(interrupt_address == | 5549 DCHECK(interrupt_address == |
5550 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5550 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5551 return OSR_AFTER_STACK_CHECK; | 5551 return OSR_AFTER_STACK_CHECK; |
5552 } | 5552 } |
5553 } // namespace internal | 5553 } // namespace internal |
5554 } // namespace v8 | 5554 } // namespace v8 |
5555 #endif // V8_TARGET_ARCH_PPC | 5555 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |