| 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 3949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3960 case Token::TYPEOF: { | 3960 case Token::TYPEOF: { |
| 3961 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 3961 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
| 3962 { StackValueContext context(this); | 3962 { StackValueContext context(this); |
| 3963 VisitForTypeofValue(expr->expression()); | 3963 VisitForTypeofValue(expr->expression()); |
| 3964 } | 3964 } |
| 3965 __ CallRuntime(Runtime::kTypeof, 1); | 3965 __ CallRuntime(Runtime::kTypeof, 1); |
| 3966 context()->Plug(eax); | 3966 context()->Plug(eax); |
| 3967 break; | 3967 break; |
| 3968 } | 3968 } |
| 3969 | 3969 |
| 3970 case Token::ADD: { | |
| 3971 Comment cmt(masm_, "[ UnaryOperation (ADD)"); | |
| 3972 VisitForAccumulatorValue(expr->expression()); | |
| 3973 Label no_conversion; | |
| 3974 __ JumpIfSmi(result_register(), &no_conversion); | |
| 3975 ToNumberStub convert_stub; | |
| 3976 __ CallStub(&convert_stub); | |
| 3977 __ bind(&no_conversion); | |
| 3978 context()->Plug(result_register()); | |
| 3979 break; | |
| 3980 } | |
| 3981 | |
| 3982 case Token::SUB: | 3970 case Token::SUB: |
| 3983 EmitUnaryOperation(expr, "[ UnaryOperation (SUB)"); | 3971 EmitUnaryOperation(expr, "[ UnaryOperation (SUB)"); |
| 3984 break; | 3972 break; |
| 3985 | 3973 |
| 3986 case Token::BIT_NOT: | 3974 case Token::BIT_NOT: |
| 3987 EmitUnaryOperation(expr, "[ UnaryOperation (BIT_NOT)"); | 3975 EmitUnaryOperation(expr, "[ UnaryOperation (BIT_NOT)"); |
| 3988 break; | 3976 break; |
| 3989 | 3977 |
| 3990 default: | 3978 default: |
| 3991 UNREACHABLE(); | 3979 UNREACHABLE(); |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4558 *stack_depth = 0; | 4546 *stack_depth = 0; |
| 4559 *context_length = 0; | 4547 *context_length = 0; |
| 4560 return previous_; | 4548 return previous_; |
| 4561 } | 4549 } |
| 4562 | 4550 |
| 4563 #undef __ | 4551 #undef __ |
| 4564 | 4552 |
| 4565 } } // namespace v8::internal | 4553 } } // namespace v8::internal |
| 4566 | 4554 |
| 4567 #endif // V8_TARGET_ARCH_IA32 | 4555 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |