| 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 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2450 __ pop(left); | 2450 __ pop(left); |
| 2451 __ mov(a0, result_register()); | 2451 __ mov(a0, result_register()); |
| 2452 | 2452 |
| 2453 // Perform combined smi check on both operands. | 2453 // Perform combined smi check on both operands. |
| 2454 __ Or(scratch1, left, Operand(right)); | 2454 __ Or(scratch1, left, Operand(right)); |
| 2455 STATIC_ASSERT(kSmiTag == 0); | 2455 STATIC_ASSERT(kSmiTag == 0); |
| 2456 JumpPatchSite patch_site(masm_); | 2456 JumpPatchSite patch_site(masm_); |
| 2457 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2457 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
| 2458 | 2458 |
| 2459 __ bind(&stub_call); | 2459 __ bind(&stub_call); |
| 2460 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 2460 Handle<Code> code = CodeFactory::BinaryOpIC( |
| 2461 isolate(), op, language_mode()).code(); |
| 2461 CallIC(code, expr->BinaryOperationFeedbackId()); | 2462 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2462 patch_site.EmitPatchInfo(); | 2463 patch_site.EmitPatchInfo(); |
| 2463 __ jmp(&done); | 2464 __ jmp(&done); |
| 2464 | 2465 |
| 2465 __ bind(&smi_case); | 2466 __ bind(&smi_case); |
| 2466 // Smi case. This code works the same way as the smi-smi case in the type | 2467 // Smi case. This code works the same way as the smi-smi case in the type |
| 2467 // recording binary operation stub, see | 2468 // recording binary operation stub, see |
| 2468 switch (op) { | 2469 switch (op) { |
| 2469 case Token::SAR: | 2470 case Token::SAR: |
| 2470 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2471 __ GetLeastBitsFromSmi(scratch1, right, 5); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2592 __ CallRuntime(Runtime::kToFastProperties, 1); | 2593 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2593 | 2594 |
| 2594 // constructor | 2595 // constructor |
| 2595 __ CallRuntime(Runtime::kToFastProperties, 1); | 2596 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2596 } | 2597 } |
| 2597 | 2598 |
| 2598 | 2599 |
| 2599 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2600 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2600 __ mov(a0, result_register()); | 2601 __ mov(a0, result_register()); |
| 2601 __ pop(a1); | 2602 __ pop(a1); |
| 2602 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 2603 Handle<Code> code = CodeFactory::BinaryOpIC( |
| 2604 isolate(), op, language_mode()).code(); |
| 2603 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2605 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2604 CallIC(code, expr->BinaryOperationFeedbackId()); | 2606 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2605 patch_site.EmitPatchInfo(); | 2607 patch_site.EmitPatchInfo(); |
| 2606 context()->Plug(v0); | 2608 context()->Plug(v0); |
| 2607 } | 2609 } |
| 2608 | 2610 |
| 2609 | 2611 |
| 2610 void FullCodeGenerator::EmitAssignment(Expression* expr) { | 2612 void FullCodeGenerator::EmitAssignment(Expression* expr) { |
| 2611 DCHECK(expr->IsValidReferenceExpression()); | 2613 DCHECK(expr->IsValidReferenceExpression()); |
| 2612 | 2614 |
| (...skipping 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5000 } | 5002 } |
| 5001 } | 5003 } |
| 5002 | 5004 |
| 5003 __ bind(&stub_call); | 5005 __ bind(&stub_call); |
| 5004 __ mov(a1, v0); | 5006 __ mov(a1, v0); |
| 5005 __ li(a0, Operand(Smi::FromInt(count_value))); | 5007 __ li(a0, Operand(Smi::FromInt(count_value))); |
| 5006 | 5008 |
| 5007 // Record position before stub call. | 5009 // Record position before stub call. |
| 5008 SetSourcePosition(expr->position()); | 5010 SetSourcePosition(expr->position()); |
| 5009 | 5011 |
| 5010 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); | 5012 Handle<Code> code = CodeFactory::BinaryOpIC( |
| 5013 isolate(), Token::ADD, language_mode()).code(); |
| 5011 CallIC(code, expr->CountBinOpFeedbackId()); | 5014 CallIC(code, expr->CountBinOpFeedbackId()); |
| 5012 patch_site.EmitPatchInfo(); | 5015 patch_site.EmitPatchInfo(); |
| 5013 __ bind(&done); | 5016 __ bind(&done); |
| 5014 | 5017 |
| 5015 // Store the value returned in v0. | 5018 // Store the value returned in v0. |
| 5016 switch (assign_type) { | 5019 switch (assign_type) { |
| 5017 case VARIABLE: | 5020 case VARIABLE: |
| 5018 if (expr->is_postfix()) { | 5021 if (expr->is_postfix()) { |
| 5019 { EffectContext context(this); | 5022 { EffectContext context(this); |
| 5020 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5023 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5478 Assembler::target_address_at(pc_immediate_load_address)) == | 5481 Assembler::target_address_at(pc_immediate_load_address)) == |
| 5479 reinterpret_cast<uint64_t>( | 5482 reinterpret_cast<uint64_t>( |
| 5480 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5483 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5481 return OSR_AFTER_STACK_CHECK; | 5484 return OSR_AFTER_STACK_CHECK; |
| 5482 } | 5485 } |
| 5483 | 5486 |
| 5484 | 5487 |
| 5485 } } // namespace v8::internal | 5488 } } // namespace v8::internal |
| 5486 | 5489 |
| 5487 #endif // V8_TARGET_ARCH_MIPS64 | 5490 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |