| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2594 __ CallRuntime(Runtime::kToFastProperties, 1); | 2594 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2595 | 2595 |
| 2596 // constructor | 2596 // constructor |
| 2597 __ CallRuntime(Runtime::kToFastProperties, 1); | 2597 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2598 } | 2598 } |
| 2599 | 2599 |
| 2600 | 2600 |
| 2601 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2601 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2602 __ mov(a0, result_register()); | 2602 __ mov(a0, result_register()); |
| 2603 __ pop(a1); | 2603 __ pop(a1); |
| 2604 Handle<Code> code = CodeFactory::BinaryOpIC( | 2604 Handle<Code> code = |
| 2605 isolate(), op, language_mode()).code(); | 2605 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
| 2606 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2606 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2607 CallIC(code, expr->BinaryOperationFeedbackId()); | 2607 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2608 patch_site.EmitPatchInfo(); | 2608 patch_site.EmitPatchInfo(); |
| 2609 context()->Plug(v0); | 2609 context()->Plug(v0); |
| 2610 } | 2610 } |
| 2611 | 2611 |
| 2612 | 2612 |
| 2613 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2613 void FullCodeGenerator::EmitAssignment(Expression* expr, |
| 2614 FeedbackVectorICSlot slot) { | 2614 FeedbackVectorICSlot slot) { |
| 2615 DCHECK(expr->IsValidReferenceExpression()); | 2615 DCHECK(expr->IsValidReferenceExpression()); |
| (...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5039 } | 5039 } |
| 5040 } | 5040 } |
| 5041 | 5041 |
| 5042 __ bind(&stub_call); | 5042 __ bind(&stub_call); |
| 5043 __ mov(a1, v0); | 5043 __ mov(a1, v0); |
| 5044 __ li(a0, Operand(Smi::FromInt(count_value))); | 5044 __ li(a0, Operand(Smi::FromInt(count_value))); |
| 5045 | 5045 |
| 5046 // Record position before stub call. | 5046 // Record position before stub call. |
| 5047 SetSourcePosition(expr->position()); | 5047 SetSourcePosition(expr->position()); |
| 5048 | 5048 |
| 5049 Handle<Code> code = CodeFactory::BinaryOpIC( | 5049 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, |
| 5050 isolate(), Token::ADD, language_mode()).code(); | 5050 strength(language_mode())).code(); |
| 5051 CallIC(code, expr->CountBinOpFeedbackId()); | 5051 CallIC(code, expr->CountBinOpFeedbackId()); |
| 5052 patch_site.EmitPatchInfo(); | 5052 patch_site.EmitPatchInfo(); |
| 5053 __ bind(&done); | 5053 __ bind(&done); |
| 5054 | 5054 |
| 5055 // Store the value returned in v0. | 5055 // Store the value returned in v0. |
| 5056 switch (assign_type) { | 5056 switch (assign_type) { |
| 5057 case VARIABLE: | 5057 case VARIABLE: |
| 5058 if (expr->is_postfix()) { | 5058 if (expr->is_postfix()) { |
| 5059 { EffectContext context(this); | 5059 { EffectContext context(this); |
| 5060 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5060 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5303 JumpPatchSite patch_site(masm_); | 5303 JumpPatchSite patch_site(masm_); |
| 5304 if (inline_smi_code) { | 5304 if (inline_smi_code) { |
| 5305 Label slow_case; | 5305 Label slow_case; |
| 5306 __ Or(a2, a0, Operand(a1)); | 5306 __ Or(a2, a0, Operand(a1)); |
| 5307 patch_site.EmitJumpIfNotSmi(a2, &slow_case); | 5307 patch_site.EmitJumpIfNotSmi(a2, &slow_case); |
| 5308 Split(cc, a1, Operand(a0), if_true, if_false, NULL); | 5308 Split(cc, a1, Operand(a0), if_true, if_false, NULL); |
| 5309 __ bind(&slow_case); | 5309 __ bind(&slow_case); |
| 5310 } | 5310 } |
| 5311 // Record position and call the compare IC. | 5311 // Record position and call the compare IC. |
| 5312 SetSourcePosition(expr->position()); | 5312 SetSourcePosition(expr->position()); |
| 5313 Handle<Code> ic = | 5313 Handle<Code> ic = CodeFactory::CompareIC( |
| 5314 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); | 5314 isolate(), op, strength(language_mode())).code(); |
| 5315 CallIC(ic, expr->CompareOperationFeedbackId()); | 5315 CallIC(ic, expr->CompareOperationFeedbackId()); |
| 5316 patch_site.EmitPatchInfo(); | 5316 patch_site.EmitPatchInfo(); |
| 5317 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5317 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 5318 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); | 5318 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); |
| 5319 } | 5319 } |
| 5320 } | 5320 } |
| 5321 | 5321 |
| 5322 // Convert the result of the comparison into one expected for this | 5322 // Convert the result of the comparison into one expected for this |
| 5323 // expression's context. | 5323 // expression's context. |
| 5324 context()->Plug(if_true, if_false); | 5324 context()->Plug(if_true, if_false); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5547 reinterpret_cast<uint64_t>( | 5547 reinterpret_cast<uint64_t>( |
| 5548 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5548 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5549 return OSR_AFTER_STACK_CHECK; | 5549 return OSR_AFTER_STACK_CHECK; |
| 5550 } | 5550 } |
| 5551 | 5551 |
| 5552 | 5552 |
| 5553 } // namespace internal | 5553 } // namespace internal |
| 5554 } // namespace v8 | 5554 } // namespace v8 |
| 5555 | 5555 |
| 5556 #endif // V8_TARGET_ARCH_MIPS64 | 5556 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |