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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 __ Branch(&next_test, ne, a1, Operand(a0)); | 1063 __ Branch(&next_test, ne, a1, Operand(a0)); |
1064 __ Drop(1); // Switch value is no longer needed. | 1064 __ Drop(1); // Switch value is no longer needed. |
1065 __ Branch(clause->body_target()); | 1065 __ Branch(clause->body_target()); |
1066 | 1066 |
1067 __ bind(&slow_case); | 1067 __ bind(&slow_case); |
1068 } | 1068 } |
1069 | 1069 |
1070 // Record position before stub call for type feedback. | 1070 // Record position before stub call for type feedback. |
1071 SetSourcePosition(clause->position()); | 1071 SetSourcePosition(clause->position()); |
1072 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1072 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
1073 language_mode()).code(); | 1073 strength(language_mode())).code(); |
1074 CallIC(ic, clause->CompareId()); | 1074 CallIC(ic, clause->CompareId()); |
1075 patch_site.EmitPatchInfo(); | 1075 patch_site.EmitPatchInfo(); |
1076 | 1076 |
1077 Label skip; | 1077 Label skip; |
1078 __ Branch(&skip); | 1078 __ Branch(&skip); |
1079 PrepareForBailout(clause, TOS_REG); | 1079 PrepareForBailout(clause, TOS_REG); |
1080 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 1080 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
1081 __ Branch(&next_test, ne, v0, Operand(at)); | 1081 __ Branch(&next_test, ne, v0, Operand(at)); |
1082 __ Drop(1); | 1082 __ Drop(1); |
1083 __ Branch(clause->body_target()); | 1083 __ Branch(clause->body_target()); |
(...skipping 1367 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 | 2603 |
2604 // Verify that compilation exactly consumed the number of store ic slots that | 2604 // Verify that compilation exactly consumed the number of store ic slots that |
2605 // the ClassLiteral node had to offer. | 2605 // the ClassLiteral node had to offer. |
2606 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count()); | 2606 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count()); |
2607 } | 2607 } |
2608 | 2608 |
2609 | 2609 |
2610 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2610 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2611 __ mov(a0, result_register()); | 2611 __ mov(a0, result_register()); |
2612 __ pop(a1); | 2612 __ pop(a1); |
2613 Handle<Code> code = CodeFactory::BinaryOpIC( | 2613 Handle<Code> code = |
2614 isolate(), op, language_mode()).code(); | 2614 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2615 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2615 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2616 CallIC(code, expr->BinaryOperationFeedbackId()); | 2616 CallIC(code, expr->BinaryOperationFeedbackId()); |
2617 patch_site.EmitPatchInfo(); | 2617 patch_site.EmitPatchInfo(); |
2618 context()->Plug(v0); | 2618 context()->Plug(v0); |
2619 } | 2619 } |
2620 | 2620 |
2621 | 2621 |
2622 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2622 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2623 FeedbackVectorICSlot slot) { | 2623 FeedbackVectorICSlot slot) { |
2624 DCHECK(expr->IsValidReferenceExpression()); | 2624 DCHECK(expr->IsValidReferenceExpression()); |
(...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5048 } | 5048 } |
5049 } | 5049 } |
5050 | 5050 |
5051 __ bind(&stub_call); | 5051 __ bind(&stub_call); |
5052 __ mov(a1, v0); | 5052 __ mov(a1, v0); |
5053 __ li(a0, Operand(Smi::FromInt(count_value))); | 5053 __ li(a0, Operand(Smi::FromInt(count_value))); |
5054 | 5054 |
5055 // Record position before stub call. | 5055 // Record position before stub call. |
5056 SetSourcePosition(expr->position()); | 5056 SetSourcePosition(expr->position()); |
5057 | 5057 |
5058 Handle<Code> code = CodeFactory::BinaryOpIC( | 5058 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
5059 isolate(), Token::ADD, language_mode()).code(); | 5059 strength(language_mode())).code(); |
5060 CallIC(code, expr->CountBinOpFeedbackId()); | 5060 CallIC(code, expr->CountBinOpFeedbackId()); |
5061 patch_site.EmitPatchInfo(); | 5061 patch_site.EmitPatchInfo(); |
5062 __ bind(&done); | 5062 __ bind(&done); |
5063 | 5063 |
5064 // Store the value returned in v0. | 5064 // Store the value returned in v0. |
5065 switch (assign_type) { | 5065 switch (assign_type) { |
5066 case VARIABLE: | 5066 case VARIABLE: |
5067 if (expr->is_postfix()) { | 5067 if (expr->is_postfix()) { |
5068 { EffectContext context(this); | 5068 { EffectContext context(this); |
5069 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5069 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5312 JumpPatchSite patch_site(masm_); | 5312 JumpPatchSite patch_site(masm_); |
5313 if (inline_smi_code) { | 5313 if (inline_smi_code) { |
5314 Label slow_case; | 5314 Label slow_case; |
5315 __ Or(a2, a0, Operand(a1)); | 5315 __ Or(a2, a0, Operand(a1)); |
5316 patch_site.EmitJumpIfNotSmi(a2, &slow_case); | 5316 patch_site.EmitJumpIfNotSmi(a2, &slow_case); |
5317 Split(cc, a1, Operand(a0), if_true, if_false, NULL); | 5317 Split(cc, a1, Operand(a0), if_true, if_false, NULL); |
5318 __ bind(&slow_case); | 5318 __ bind(&slow_case); |
5319 } | 5319 } |
5320 // Record position and call the compare IC. | 5320 // Record position and call the compare IC. |
5321 SetSourcePosition(expr->position()); | 5321 SetSourcePosition(expr->position()); |
5322 Handle<Code> ic = | 5322 Handle<Code> ic = CodeFactory::CompareIC( |
5323 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5323 isolate(), op, strength(language_mode())).code(); |
5324 CallIC(ic, expr->CompareOperationFeedbackId()); | 5324 CallIC(ic, expr->CompareOperationFeedbackId()); |
5325 patch_site.EmitPatchInfo(); | 5325 patch_site.EmitPatchInfo(); |
5326 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5326 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
5327 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); | 5327 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); |
5328 } | 5328 } |
5329 } | 5329 } |
5330 | 5330 |
5331 // Convert the result of the comparison into one expected for this | 5331 // Convert the result of the comparison into one expected for this |
5332 // expression's context. | 5332 // expression's context. |
5333 context()->Plug(if_true, if_false); | 5333 context()->Plug(if_true, if_false); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5556 reinterpret_cast<uint64_t>( | 5556 reinterpret_cast<uint64_t>( |
5557 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5557 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5558 return OSR_AFTER_STACK_CHECK; | 5558 return OSR_AFTER_STACK_CHECK; |
5559 } | 5559 } |
5560 | 5560 |
5561 | 5561 |
5562 } // namespace internal | 5562 } // namespace internal |
5563 } // namespace v8 | 5563 } // namespace v8 |
5564 | 5564 |
5565 #endif // V8_TARGET_ARCH_MIPS64 | 5565 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |