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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 __ Branch(&next_test, ne, a1, Operand(a0)); | 1066 __ Branch(&next_test, ne, a1, Operand(a0)); |
1067 __ Drop(1); // Switch value is no longer needed. | 1067 __ Drop(1); // Switch value is no longer needed. |
1068 __ Branch(clause->body_target()); | 1068 __ Branch(clause->body_target()); |
1069 | 1069 |
1070 __ bind(&slow_case); | 1070 __ bind(&slow_case); |
1071 } | 1071 } |
1072 | 1072 |
1073 // Record position before stub call for type feedback. | 1073 // Record position before stub call for type feedback. |
1074 SetSourcePosition(clause->position()); | 1074 SetSourcePosition(clause->position()); |
1075 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1075 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
1076 language_mode()).code(); | 1076 strength(language_mode())).code(); |
1077 CallIC(ic, clause->CompareId()); | 1077 CallIC(ic, clause->CompareId()); |
1078 patch_site.EmitPatchInfo(); | 1078 patch_site.EmitPatchInfo(); |
1079 | 1079 |
1080 Label skip; | 1080 Label skip; |
1081 __ Branch(&skip); | 1081 __ Branch(&skip); |
1082 PrepareForBailout(clause, TOS_REG); | 1082 PrepareForBailout(clause, TOS_REG); |
1083 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 1083 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
1084 __ Branch(&next_test, ne, v0, Operand(at)); | 1084 __ Branch(&next_test, ne, v0, Operand(at)); |
1085 __ Drop(1); | 1085 __ Drop(1); |
1086 __ Branch(clause->body_target()); | 1086 __ Branch(clause->body_target()); |
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2451 __ pop(left); | 2451 __ pop(left); |
2452 __ mov(a0, result_register()); | 2452 __ mov(a0, result_register()); |
2453 | 2453 |
2454 // Perform combined smi check on both operands. | 2454 // Perform combined smi check on both operands. |
2455 __ Or(scratch1, left, Operand(right)); | 2455 __ Or(scratch1, left, Operand(right)); |
2456 STATIC_ASSERT(kSmiTag == 0); | 2456 STATIC_ASSERT(kSmiTag == 0); |
2457 JumpPatchSite patch_site(masm_); | 2457 JumpPatchSite patch_site(masm_); |
2458 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2458 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
2459 | 2459 |
2460 __ bind(&stub_call); | 2460 __ bind(&stub_call); |
2461 Handle<Code> code = CodeFactory::BinaryOpIC( | 2461 Handle<Code> code = |
2462 isolate(), op, language_mode()).code(); | 2462 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2463 CallIC(code, expr->BinaryOperationFeedbackId()); | 2463 CallIC(code, expr->BinaryOperationFeedbackId()); |
2464 patch_site.EmitPatchInfo(); | 2464 patch_site.EmitPatchInfo(); |
2465 __ jmp(&done); | 2465 __ jmp(&done); |
2466 | 2466 |
2467 __ bind(&smi_case); | 2467 __ bind(&smi_case); |
2468 // Smi case. This code works the same way as the smi-smi case in the type | 2468 // Smi case. This code works the same way as the smi-smi case in the type |
2469 // recording binary operation stub, see | 2469 // recording binary operation stub, see |
2470 switch (op) { | 2470 switch (op) { |
2471 case Token::SAR: | 2471 case Token::SAR: |
2472 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2472 __ GetLeastBitsFromSmi(scratch1, right, 5); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2604 | 2604 |
2605 // Verify that compilation exactly consumed the number of store ic slots that | 2605 // Verify that compilation exactly consumed the number of store ic slots that |
2606 // the ClassLiteral node had to offer. | 2606 // the ClassLiteral node had to offer. |
2607 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count()); | 2607 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count()); |
2608 } | 2608 } |
2609 | 2609 |
2610 | 2610 |
2611 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2611 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2612 __ mov(a0, result_register()); | 2612 __ mov(a0, result_register()); |
2613 __ pop(a1); | 2613 __ pop(a1); |
2614 Handle<Code> code = CodeFactory::BinaryOpIC( | 2614 Handle<Code> code = |
2615 isolate(), op, language_mode()).code(); | 2615 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2616 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2616 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2617 CallIC(code, expr->BinaryOperationFeedbackId()); | 2617 CallIC(code, expr->BinaryOperationFeedbackId()); |
2618 patch_site.EmitPatchInfo(); | 2618 patch_site.EmitPatchInfo(); |
2619 context()->Plug(v0); | 2619 context()->Plug(v0); |
2620 } | 2620 } |
2621 | 2621 |
2622 | 2622 |
2623 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2623 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2624 FeedbackVectorICSlot slot) { | 2624 FeedbackVectorICSlot slot) { |
2625 DCHECK(expr->IsValidReferenceExpression()); | 2625 DCHECK(expr->IsValidReferenceExpression()); |
(...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5045 } | 5045 } |
5046 } | 5046 } |
5047 | 5047 |
5048 __ bind(&stub_call); | 5048 __ bind(&stub_call); |
5049 __ mov(a1, v0); | 5049 __ mov(a1, v0); |
5050 __ li(a0, Operand(Smi::FromInt(count_value))); | 5050 __ li(a0, Operand(Smi::FromInt(count_value))); |
5051 | 5051 |
5052 // Record position before stub call. | 5052 // Record position before stub call. |
5053 SetSourcePosition(expr->position()); | 5053 SetSourcePosition(expr->position()); |
5054 | 5054 |
5055 Handle<Code> code = CodeFactory::BinaryOpIC( | 5055 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
5056 isolate(), Token::ADD, language_mode()).code(); | 5056 strength(language_mode())).code(); |
5057 CallIC(code, expr->CountBinOpFeedbackId()); | 5057 CallIC(code, expr->CountBinOpFeedbackId()); |
5058 patch_site.EmitPatchInfo(); | 5058 patch_site.EmitPatchInfo(); |
5059 __ bind(&done); | 5059 __ bind(&done); |
5060 | 5060 |
5061 // Store the value returned in v0. | 5061 // Store the value returned in v0. |
5062 switch (assign_type) { | 5062 switch (assign_type) { |
5063 case VARIABLE: | 5063 case VARIABLE: |
5064 if (expr->is_postfix()) { | 5064 if (expr->is_postfix()) { |
5065 { EffectContext context(this); | 5065 { EffectContext context(this); |
5066 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5066 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5309 JumpPatchSite patch_site(masm_); | 5309 JumpPatchSite patch_site(masm_); |
5310 if (inline_smi_code) { | 5310 if (inline_smi_code) { |
5311 Label slow_case; | 5311 Label slow_case; |
5312 __ Or(a2, a0, Operand(a1)); | 5312 __ Or(a2, a0, Operand(a1)); |
5313 patch_site.EmitJumpIfNotSmi(a2, &slow_case); | 5313 patch_site.EmitJumpIfNotSmi(a2, &slow_case); |
5314 Split(cc, a1, Operand(a0), if_true, if_false, NULL); | 5314 Split(cc, a1, Operand(a0), if_true, if_false, NULL); |
5315 __ bind(&slow_case); | 5315 __ bind(&slow_case); |
5316 } | 5316 } |
5317 // Record position and call the compare IC. | 5317 // Record position and call the compare IC. |
5318 SetSourcePosition(expr->position()); | 5318 SetSourcePosition(expr->position()); |
5319 Handle<Code> ic = | 5319 Handle<Code> ic = CodeFactory::CompareIC( |
5320 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5320 isolate(), op, strength(language_mode())).code(); |
5321 CallIC(ic, expr->CompareOperationFeedbackId()); | 5321 CallIC(ic, expr->CompareOperationFeedbackId()); |
5322 patch_site.EmitPatchInfo(); | 5322 patch_site.EmitPatchInfo(); |
5323 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5323 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
5324 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); | 5324 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); |
5325 } | 5325 } |
5326 } | 5326 } |
5327 | 5327 |
5328 // Convert the result of the comparison into one expected for this | 5328 // Convert the result of the comparison into one expected for this |
5329 // expression's context. | 5329 // expression's context. |
5330 context()->Plug(if_true, if_false); | 5330 context()->Plug(if_true, if_false); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5549 reinterpret_cast<uint32_t>( | 5549 reinterpret_cast<uint32_t>( |
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 | 5553 |
5554 | 5554 |
5555 } // namespace internal | 5555 } // namespace internal |
5556 } // namespace v8 | 5556 } // namespace v8 |
5557 | 5557 |
5558 #endif // V8_TARGET_ARCH_MIPS | 5558 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |