OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3988 case Token::TYPEOF: { | 3988 case Token::TYPEOF: { |
3989 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 3989 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
3990 { StackValueContext context(this); | 3990 { StackValueContext context(this); |
3991 VisitForTypeofValue(expr->expression()); | 3991 VisitForTypeofValue(expr->expression()); |
3992 } | 3992 } |
3993 __ CallRuntime(Runtime::kTypeof, 1); | 3993 __ CallRuntime(Runtime::kTypeof, 1); |
3994 context()->Plug(v0); | 3994 context()->Plug(v0); |
3995 break; | 3995 break; |
3996 } | 3996 } |
3997 | 3997 |
3998 case Token::ADD: { | |
3999 Comment cmt(masm_, "[ UnaryOperation (ADD)"); | |
4000 VisitForAccumulatorValue(expr->expression()); | |
4001 Label no_conversion; | |
4002 __ JumpIfSmi(result_register(), &no_conversion); | |
4003 __ mov(a0, result_register()); | |
4004 ToNumberStub convert_stub; | |
4005 __ CallStub(&convert_stub); | |
4006 __ bind(&no_conversion); | |
4007 context()->Plug(result_register()); | |
4008 break; | |
4009 } | |
4010 | |
4011 case Token::SUB: | 3998 case Token::SUB: |
4012 EmitUnaryOperation(expr, "[ UnaryOperation (SUB)"); | 3999 EmitUnaryOperation(expr, "[ UnaryOperation (SUB)"); |
4013 break; | 4000 break; |
4014 | 4001 |
4015 case Token::BIT_NOT: | 4002 case Token::BIT_NOT: |
4016 EmitUnaryOperation(expr, "[ UnaryOperation (BIT_NOT)"); | 4003 EmitUnaryOperation(expr, "[ UnaryOperation (BIT_NOT)"); |
4017 break; | 4004 break; |
4018 | 4005 |
4019 default: | 4006 default: |
4020 UNREACHABLE(); | 4007 UNREACHABLE(); |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4583 *context_length = 0; | 4570 *context_length = 0; |
4584 return previous_; | 4571 return previous_; |
4585 } | 4572 } |
4586 | 4573 |
4587 | 4574 |
4588 #undef __ | 4575 #undef __ |
4589 | 4576 |
4590 } } // namespace v8::internal | 4577 } } // namespace v8::internal |
4591 | 4578 |
4592 #endif // V8_TARGET_ARCH_MIPS | 4579 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |