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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 __ cmp(r4, r3); | 1030 __ cmp(r4, r3); |
1031 __ bne(&next_test); | 1031 __ bne(&next_test); |
1032 __ Drop(1); // Switch value is no longer needed. | 1032 __ Drop(1); // Switch value is no longer needed. |
1033 __ b(clause->body_target()); | 1033 __ b(clause->body_target()); |
1034 __ bind(&slow_case); | 1034 __ bind(&slow_case); |
1035 } | 1035 } |
1036 | 1036 |
1037 // Record position before stub call for type feedback. | 1037 // Record position before stub call for type feedback. |
1038 SetSourcePosition(clause->position()); | 1038 SetSourcePosition(clause->position()); |
1039 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1039 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
1040 language_mode()).code(); | 1040 strength(language_mode())).code(); |
1041 CallIC(ic, clause->CompareId()); | 1041 CallIC(ic, clause->CompareId()); |
1042 patch_site.EmitPatchInfo(); | 1042 patch_site.EmitPatchInfo(); |
1043 | 1043 |
1044 Label skip; | 1044 Label skip; |
1045 __ b(&skip); | 1045 __ b(&skip); |
1046 PrepareForBailout(clause, TOS_REG); | 1046 PrepareForBailout(clause, TOS_REG); |
1047 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 1047 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
1048 __ cmp(r3, ip); | 1048 __ cmp(r3, ip); |
1049 __ bne(&next_test); | 1049 __ bne(&next_test); |
1050 __ Drop(1); | 1050 __ Drop(1); |
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2428 Register right = r3; | 2428 Register right = r3; |
2429 __ pop(left); | 2429 __ pop(left); |
2430 | 2430 |
2431 // Perform combined smi check on both operands. | 2431 // Perform combined smi check on both operands. |
2432 __ orx(scratch1, left, right); | 2432 __ orx(scratch1, left, right); |
2433 STATIC_ASSERT(kSmiTag == 0); | 2433 STATIC_ASSERT(kSmiTag == 0); |
2434 JumpPatchSite patch_site(masm_); | 2434 JumpPatchSite patch_site(masm_); |
2435 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2435 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
2436 | 2436 |
2437 __ bind(&stub_call); | 2437 __ bind(&stub_call); |
2438 Handle<Code> code = CodeFactory::BinaryOpIC( | 2438 Handle<Code> code = |
2439 isolate(), op, language_mode()).code(); | 2439 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2440 CallIC(code, expr->BinaryOperationFeedbackId()); | 2440 CallIC(code, expr->BinaryOperationFeedbackId()); |
2441 patch_site.EmitPatchInfo(); | 2441 patch_site.EmitPatchInfo(); |
2442 __ b(&done); | 2442 __ b(&done); |
2443 | 2443 |
2444 __ bind(&smi_case); | 2444 __ bind(&smi_case); |
2445 // Smi case. This code works the same way as the smi-smi case in the type | 2445 // Smi case. This code works the same way as the smi-smi case in the type |
2446 // recording binary operation stub. | 2446 // recording binary operation stub. |
2447 switch (op) { | 2447 switch (op) { |
2448 case Token::SAR: | 2448 case Token::SAR: |
2449 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2449 __ GetLeastBitsFromSmi(scratch1, right, 5); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2605 // prototype | 2605 // prototype |
2606 __ CallRuntime(Runtime::kToFastProperties, 1); | 2606 __ CallRuntime(Runtime::kToFastProperties, 1); |
2607 | 2607 |
2608 // constructor | 2608 // constructor |
2609 __ CallRuntime(Runtime::kToFastProperties, 1); | 2609 __ CallRuntime(Runtime::kToFastProperties, 1); |
2610 } | 2610 } |
2611 | 2611 |
2612 | 2612 |
2613 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2613 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2614 __ pop(r4); | 2614 __ pop(r4); |
2615 Handle<Code> code = CodeFactory::BinaryOpIC( | 2615 Handle<Code> code = |
2616 isolate(), op, language_mode()).code(); | 2616 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2617 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2617 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2618 CallIC(code, expr->BinaryOperationFeedbackId()); | 2618 CallIC(code, expr->BinaryOperationFeedbackId()); |
2619 patch_site.EmitPatchInfo(); | 2619 patch_site.EmitPatchInfo(); |
2620 context()->Plug(r3); | 2620 context()->Plug(r3); |
2621 } | 2621 } |
2622 | 2622 |
2623 | 2623 |
2624 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2624 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2625 FeedbackVectorICSlot slot) { | 2625 FeedbackVectorICSlot slot) { |
2626 DCHECK(expr->IsValidReferenceExpression()); | 2626 DCHECK(expr->IsValidReferenceExpression()); |
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5016 } | 5016 } |
5017 } | 5017 } |
5018 | 5018 |
5019 __ bind(&stub_call); | 5019 __ bind(&stub_call); |
5020 __ mr(r4, r3); | 5020 __ mr(r4, r3); |
5021 __ LoadSmiLiteral(r3, Smi::FromInt(count_value)); | 5021 __ LoadSmiLiteral(r3, Smi::FromInt(count_value)); |
5022 | 5022 |
5023 // Record position before stub call. | 5023 // Record position before stub call. |
5024 SetSourcePosition(expr->position()); | 5024 SetSourcePosition(expr->position()); |
5025 | 5025 |
5026 Handle<Code> code = CodeFactory::BinaryOpIC( | 5026 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
5027 isolate(), Token::ADD, language_mode()).code(); | 5027 strength(language_mode())).code(); |
5028 CallIC(code, expr->CountBinOpFeedbackId()); | 5028 CallIC(code, expr->CountBinOpFeedbackId()); |
5029 patch_site.EmitPatchInfo(); | 5029 patch_site.EmitPatchInfo(); |
5030 __ bind(&done); | 5030 __ bind(&done); |
5031 | 5031 |
5032 // Store the value returned in r3. | 5032 // Store the value returned in r3. |
5033 switch (assign_type) { | 5033 switch (assign_type) { |
5034 case VARIABLE: | 5034 case VARIABLE: |
5035 if (expr->is_postfix()) { | 5035 if (expr->is_postfix()) { |
5036 { | 5036 { |
5037 EffectContext context(this); | 5037 EffectContext context(this); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5286 Label slow_case; | 5286 Label slow_case; |
5287 __ orx(r5, r3, r4); | 5287 __ orx(r5, r3, r4); |
5288 patch_site.EmitJumpIfNotSmi(r5, &slow_case); | 5288 patch_site.EmitJumpIfNotSmi(r5, &slow_case); |
5289 __ cmp(r4, r3); | 5289 __ cmp(r4, r3); |
5290 Split(cond, if_true, if_false, NULL); | 5290 Split(cond, if_true, if_false, NULL); |
5291 __ bind(&slow_case); | 5291 __ bind(&slow_case); |
5292 } | 5292 } |
5293 | 5293 |
5294 // Record position and call the compare IC. | 5294 // Record position and call the compare IC. |
5295 SetSourcePosition(expr->position()); | 5295 SetSourcePosition(expr->position()); |
5296 Handle<Code> ic = | 5296 Handle<Code> ic = CodeFactory::CompareIC( |
5297 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5297 isolate(), op, strength(language_mode())).code(); |
5298 CallIC(ic, expr->CompareOperationFeedbackId()); | 5298 CallIC(ic, expr->CompareOperationFeedbackId()); |
5299 patch_site.EmitPatchInfo(); | 5299 patch_site.EmitPatchInfo(); |
5300 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5300 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
5301 __ cmpi(r3, Operand::Zero()); | 5301 __ cmpi(r3, Operand::Zero()); |
5302 Split(cond, if_true, if_false, fall_through); | 5302 Split(cond, if_true, if_false, fall_through); |
5303 } | 5303 } |
5304 } | 5304 } |
5305 | 5305 |
5306 // Convert the result of the comparison into one expected for this | 5306 // Convert the result of the comparison into one expected for this |
5307 // expression's context. | 5307 // expression's context. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5516 return ON_STACK_REPLACEMENT; | 5516 return ON_STACK_REPLACEMENT; |
5517 } | 5517 } |
5518 | 5518 |
5519 DCHECK(interrupt_address == | 5519 DCHECK(interrupt_address == |
5520 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5520 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5521 return OSR_AFTER_STACK_CHECK; | 5521 return OSR_AFTER_STACK_CHECK; |
5522 } | 5522 } |
5523 } // namespace internal | 5523 } // namespace internal |
5524 } // namespace v8 | 5524 } // namespace v8 |
5525 #endif // V8_TARGET_ARCH_PPC | 5525 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |