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 2440 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(isolate(), op).code(); | 2461 Handle<Code> code = CodeFactory::BinaryOpIC( |
| 2462 isolate(), op, language_mode()).code(); |
2462 CallIC(code, expr->BinaryOperationFeedbackId()); | 2463 CallIC(code, expr->BinaryOperationFeedbackId()); |
2463 patch_site.EmitPatchInfo(); | 2464 patch_site.EmitPatchInfo(); |
2464 __ jmp(&done); | 2465 __ jmp(&done); |
2465 | 2466 |
2466 __ bind(&smi_case); | 2467 __ bind(&smi_case); |
2467 // 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 |
2468 // recording binary operation stub, see | 2469 // recording binary operation stub, see |
2469 switch (op) { | 2470 switch (op) { |
2470 case Token::SAR: | 2471 case Token::SAR: |
2471 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2472 __ GetLeastBitsFromSmi(scratch1, right, 5); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 __ CallRuntime(Runtime::kToFastProperties, 1); | 2595 __ CallRuntime(Runtime::kToFastProperties, 1); |
2595 | 2596 |
2596 // constructor | 2597 // constructor |
2597 __ CallRuntime(Runtime::kToFastProperties, 1); | 2598 __ CallRuntime(Runtime::kToFastProperties, 1); |
2598 } | 2599 } |
2599 | 2600 |
2600 | 2601 |
2601 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2602 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2602 __ mov(a0, result_register()); | 2603 __ mov(a0, result_register()); |
2603 __ pop(a1); | 2604 __ pop(a1); |
2604 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 2605 Handle<Code> code = CodeFactory::BinaryOpIC( |
| 2606 isolate(), op, language_mode()).code(); |
2605 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2607 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2606 CallIC(code, expr->BinaryOperationFeedbackId()); | 2608 CallIC(code, expr->BinaryOperationFeedbackId()); |
2607 patch_site.EmitPatchInfo(); | 2609 patch_site.EmitPatchInfo(); |
2608 context()->Plug(v0); | 2610 context()->Plug(v0); |
2609 } | 2611 } |
2610 | 2612 |
2611 | 2613 |
2612 void FullCodeGenerator::EmitAssignment(Expression* expr) { | 2614 void FullCodeGenerator::EmitAssignment(Expression* expr) { |
2613 DCHECK(expr->IsValidReferenceExpression()); | 2615 DCHECK(expr->IsValidReferenceExpression()); |
2614 | 2616 |
(...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4998 } | 5000 } |
4999 } | 5001 } |
5000 | 5002 |
5001 __ bind(&stub_call); | 5003 __ bind(&stub_call); |
5002 __ mov(a1, v0); | 5004 __ mov(a1, v0); |
5003 __ li(a0, Operand(Smi::FromInt(count_value))); | 5005 __ li(a0, Operand(Smi::FromInt(count_value))); |
5004 | 5006 |
5005 // Record position before stub call. | 5007 // Record position before stub call. |
5006 SetSourcePosition(expr->position()); | 5008 SetSourcePosition(expr->position()); |
5007 | 5009 |
5008 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); | 5010 Handle<Code> code = CodeFactory::BinaryOpIC( |
| 5011 isolate(), Token::ADD, language_mode()).code(); |
5009 CallIC(code, expr->CountBinOpFeedbackId()); | 5012 CallIC(code, expr->CountBinOpFeedbackId()); |
5010 patch_site.EmitPatchInfo(); | 5013 patch_site.EmitPatchInfo(); |
5011 __ bind(&done); | 5014 __ bind(&done); |
5012 | 5015 |
5013 // Store the value returned in v0. | 5016 // Store the value returned in v0. |
5014 switch (assign_type) { | 5017 switch (assign_type) { |
5015 case VARIABLE: | 5018 case VARIABLE: |
5016 if (expr->is_postfix()) { | 5019 if (expr->is_postfix()) { |
5017 { EffectContext context(this); | 5020 { EffectContext context(this); |
5018 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5021 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5472 Assembler::target_address_at(pc_immediate_load_address)) == | 5475 Assembler::target_address_at(pc_immediate_load_address)) == |
5473 reinterpret_cast<uint32_t>( | 5476 reinterpret_cast<uint32_t>( |
5474 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5477 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5475 return OSR_AFTER_STACK_CHECK; | 5478 return OSR_AFTER_STACK_CHECK; |
5476 } | 5479 } |
5477 | 5480 |
5478 | 5481 |
5479 } } // namespace v8::internal | 5482 } } // namespace v8::internal |
5480 | 5483 |
5481 #endif // V8_TARGET_ARCH_MIPS | 5484 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |