| 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 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 __ Branch(&next_test, ne, a1, Operand(a0)); | 1081 __ Branch(&next_test, ne, a1, Operand(a0)); |
| 1082 __ Drop(1); // Switch value is no longer needed. | 1082 __ Drop(1); // Switch value is no longer needed. |
| 1083 __ Branch(clause->body_target()); | 1083 __ Branch(clause->body_target()); |
| 1084 | 1084 |
| 1085 __ bind(&slow_case); | 1085 __ bind(&slow_case); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 // Record position before stub call for type feedback. | 1088 // Record position before stub call for type feedback. |
| 1089 SetSourcePosition(clause->position()); | 1089 SetSourcePosition(clause->position()); |
| 1090 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 1090 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, |
| 1091 language_mode()).code(); | 1091 strength(language_mode())).code(); |
| 1092 CallIC(ic, clause->CompareId()); | 1092 CallIC(ic, clause->CompareId()); |
| 1093 patch_site.EmitPatchInfo(); | 1093 patch_site.EmitPatchInfo(); |
| 1094 | 1094 |
| 1095 Label skip; | 1095 Label skip; |
| 1096 __ Branch(&skip); | 1096 __ Branch(&skip); |
| 1097 PrepareForBailout(clause, TOS_REG); | 1097 PrepareForBailout(clause, TOS_REG); |
| 1098 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 1098 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
| 1099 __ Branch(&next_test, ne, v0, Operand(at)); | 1099 __ Branch(&next_test, ne, v0, Operand(at)); |
| 1100 __ Drop(1); | 1100 __ Drop(1); |
| 1101 __ Branch(clause->body_target()); | 1101 __ Branch(clause->body_target()); |
| (...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2469 __ pop(left); | 2469 __ pop(left); |
| 2470 __ mov(a0, result_register()); | 2470 __ mov(a0, result_register()); |
| 2471 | 2471 |
| 2472 // Perform combined smi check on both operands. | 2472 // Perform combined smi check on both operands. |
| 2473 __ Or(scratch1, left, Operand(right)); | 2473 __ Or(scratch1, left, Operand(right)); |
| 2474 STATIC_ASSERT(kSmiTag == 0); | 2474 STATIC_ASSERT(kSmiTag == 0); |
| 2475 JumpPatchSite patch_site(masm_); | 2475 JumpPatchSite patch_site(masm_); |
| 2476 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2476 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
| 2477 | 2477 |
| 2478 __ bind(&stub_call); | 2478 __ bind(&stub_call); |
| 2479 Handle<Code> code = CodeFactory::BinaryOpIC( | 2479 Handle<Code> code = |
| 2480 isolate(), op, language_mode()).code(); | 2480 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2481 CallIC(code, expr->BinaryOperationFeedbackId()); | 2481 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2482 patch_site.EmitPatchInfo(); | 2482 patch_site.EmitPatchInfo(); |
| 2483 __ jmp(&done); | 2483 __ jmp(&done); |
| 2484 | 2484 |
| 2485 __ bind(&smi_case); | 2485 __ bind(&smi_case); |
| 2486 // Smi case. This code works the same way as the smi-smi case in the type | 2486 // Smi case. This code works the same way as the smi-smi case in the type |
| 2487 // recording binary operation stub, see | 2487 // recording binary operation stub, see |
| 2488 switch (op) { | 2488 switch (op) { |
| 2489 case Token::SAR: | 2489 case Token::SAR: |
| 2490 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2490 __ GetLeastBitsFromSmi(scratch1, right, 5); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2612 __ CallRuntime(Runtime::kToFastProperties, 1); | 2612 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2613 | 2613 |
| 2614 // constructor | 2614 // constructor |
| 2615 __ CallRuntime(Runtime::kToFastProperties, 1); | 2615 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2616 } | 2616 } |
| 2617 | 2617 |
| 2618 | 2618 |
| 2619 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2619 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2620 __ mov(a0, result_register()); | 2620 __ mov(a0, result_register()); |
| 2621 __ pop(a1); | 2621 __ pop(a1); |
| 2622 Handle<Code> code = CodeFactory::BinaryOpIC( | 2622 Handle<Code> code = |
| 2623 isolate(), op, language_mode()).code(); | 2623 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2624 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2624 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2625 CallIC(code, expr->BinaryOperationFeedbackId()); | 2625 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2626 patch_site.EmitPatchInfo(); | 2626 patch_site.EmitPatchInfo(); |
| 2627 context()->Plug(v0); | 2627 context()->Plug(v0); |
| 2628 } | 2628 } |
| 2629 | 2629 |
| 2630 | 2630 |
| 2631 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2631 void FullCodeGenerator::EmitAssignment(Expression* expr, |
| 2632 FeedbackVectorICSlot slot) { | 2632 FeedbackVectorICSlot slot) { |
| 2633 DCHECK(expr->IsValidReferenceExpression()); | 2633 DCHECK(expr->IsValidReferenceExpression()); |
| (...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5057 } | 5057 } |
| 5058 } | 5058 } |
| 5059 | 5059 |
| 5060 __ bind(&stub_call); | 5060 __ bind(&stub_call); |
| 5061 __ mov(a1, v0); | 5061 __ mov(a1, v0); |
| 5062 __ li(a0, Operand(Smi::FromInt(count_value))); | 5062 __ li(a0, Operand(Smi::FromInt(count_value))); |
| 5063 | 5063 |
| 5064 // Record position before stub call. | 5064 // Record position before stub call. |
| 5065 SetSourcePosition(expr->position()); | 5065 SetSourcePosition(expr->position()); |
| 5066 | 5066 |
| 5067 Handle<Code> code = CodeFactory::BinaryOpIC( | 5067 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
| 5068 isolate(), Token::ADD, language_mode()).code(); | 5068 strength(language_mode())).code(); |
| 5069 CallIC(code, expr->CountBinOpFeedbackId()); | 5069 CallIC(code, expr->CountBinOpFeedbackId()); |
| 5070 patch_site.EmitPatchInfo(); | 5070 patch_site.EmitPatchInfo(); |
| 5071 __ bind(&done); | 5071 __ bind(&done); |
| 5072 | 5072 |
| 5073 // Store the value returned in v0. | 5073 // Store the value returned in v0. |
| 5074 switch (assign_type) { | 5074 switch (assign_type) { |
| 5075 case VARIABLE: | 5075 case VARIABLE: |
| 5076 if (expr->is_postfix()) { | 5076 if (expr->is_postfix()) { |
| 5077 { EffectContext context(this); | 5077 { EffectContext context(this); |
| 5078 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5078 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5321 JumpPatchSite patch_site(masm_); | 5321 JumpPatchSite patch_site(masm_); |
| 5322 if (inline_smi_code) { | 5322 if (inline_smi_code) { |
| 5323 Label slow_case; | 5323 Label slow_case; |
| 5324 __ Or(a2, a0, Operand(a1)); | 5324 __ Or(a2, a0, Operand(a1)); |
| 5325 patch_site.EmitJumpIfNotSmi(a2, &slow_case); | 5325 patch_site.EmitJumpIfNotSmi(a2, &slow_case); |
| 5326 Split(cc, a1, Operand(a0), if_true, if_false, NULL); | 5326 Split(cc, a1, Operand(a0), if_true, if_false, NULL); |
| 5327 __ bind(&slow_case); | 5327 __ bind(&slow_case); |
| 5328 } | 5328 } |
| 5329 // Record position and call the compare IC. | 5329 // Record position and call the compare IC. |
| 5330 SetSourcePosition(expr->position()); | 5330 SetSourcePosition(expr->position()); |
| 5331 Handle<Code> ic = | 5331 Handle<Code> ic = CodeFactory::CompareIC( |
| 5332 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5332 isolate(), op, strength(language_mode())).code(); |
| 5333 CallIC(ic, expr->CompareOperationFeedbackId()); | 5333 CallIC(ic, expr->CompareOperationFeedbackId()); |
| 5334 patch_site.EmitPatchInfo(); | 5334 patch_site.EmitPatchInfo(); |
| 5335 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5335 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 5336 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); | 5336 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); |
| 5337 } | 5337 } |
| 5338 } | 5338 } |
| 5339 | 5339 |
| 5340 // Convert the result of the comparison into one expected for this | 5340 // Convert the result of the comparison into one expected for this |
| 5341 // expression's context. | 5341 // expression's context. |
| 5342 context()->Plug(if_true, if_false); | 5342 context()->Plug(if_true, if_false); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5565 reinterpret_cast<uint64_t>( | 5565 reinterpret_cast<uint64_t>( |
| 5566 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5566 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5567 return OSR_AFTER_STACK_CHECK; | 5567 return OSR_AFTER_STACK_CHECK; |
| 5568 } | 5568 } |
| 5569 | 5569 |
| 5570 | 5570 |
| 5571 } // namespace internal | 5571 } // namespace internal |
| 5572 } // namespace v8 | 5572 } // namespace v8 |
| 5573 | 5573 |
| 5574 #endif // V8_TARGET_ARCH_MIPS64 | 5574 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |