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