| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3497 | 3497 |
| 3498 case Token::VOID: { | 3498 case Token::VOID: { |
| 3499 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); | 3499 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); |
| 3500 VisitForEffect(expr->expression()); | 3500 VisitForEffect(expr->expression()); |
| 3501 context()->Plug(Factory::undefined_value()); | 3501 context()->Plug(Factory::undefined_value()); |
| 3502 break; | 3502 break; |
| 3503 } | 3503 } |
| 3504 | 3504 |
| 3505 case Token::NOT: { | 3505 case Token::NOT: { |
| 3506 Comment cmnt(masm_, "[ UnaryOperation (NOT)"); | 3506 Comment cmnt(masm_, "[ UnaryOperation (NOT)"); |
| 3507 | 3507 if (context()->IsEffect()) { |
| 3508 Label materialize_true, materialize_false; | 3508 // Unary NOT has no side effects so it's only necessary to visit the |
| 3509 Label* if_true = NULL; | 3509 // subexpression. Match the optimizing compiler by not branching. |
| 3510 Label* if_false = NULL; | 3510 VisitForEffect(expr->expression()); |
| 3511 Label* fall_through = NULL; | 3511 } else { |
| 3512 // Notice that the labels are swapped. | 3512 Label materialize_true, materialize_false; |
| 3513 context()->PrepareTest(&materialize_true, &materialize_false, | 3513 Label* if_true = NULL; |
| 3514 &if_false, &if_true, &fall_through); | 3514 Label* if_false = NULL; |
| 3515 if (context()->IsTest()) ForwardBailoutToChild(expr); | 3515 Label* fall_through = NULL; |
| 3516 VisitForControl(expr->expression(), if_true, if_false, fall_through); | 3516 // Notice that the labels are swapped. |
| 3517 context()->Plug(if_false, if_true); // Labels swapped. | 3517 context()->PrepareTest(&materialize_true, &materialize_false, |
| 3518 &if_false, &if_true, &fall_through); |
| 3519 if (context()->IsTest()) ForwardBailoutToChild(expr); |
| 3520 VisitForControl(expr->expression(), if_true, if_false, fall_through); |
| 3521 context()->Plug(if_false, if_true); // Labels swapped. |
| 3522 } |
| 3518 break; | 3523 break; |
| 3519 } | 3524 } |
| 3520 | 3525 |
| 3521 case Token::TYPEOF: { | 3526 case Token::TYPEOF: { |
| 3522 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 3527 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
| 3523 { StackValueContext context(this); | 3528 { StackValueContext context(this); |
| 3524 VisitForTypeofValue(expr->expression()); | 3529 VisitForTypeofValue(expr->expression()); |
| 3525 } | 3530 } |
| 3526 __ CallRuntime(Runtime::kTypeof, 1); | 3531 __ CallRuntime(Runtime::kTypeof, 1); |
| 3527 context()->Plug(eax); | 3532 context()->Plug(eax); |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4153 // And return. | 4158 // And return. |
| 4154 __ ret(0); | 4159 __ ret(0); |
| 4155 } | 4160 } |
| 4156 | 4161 |
| 4157 | 4162 |
| 4158 #undef __ | 4163 #undef __ |
| 4159 | 4164 |
| 4160 } } // namespace v8::internal | 4165 } } // namespace v8::internal |
| 4161 | 4166 |
| 4162 #endif // V8_TARGET_ARCH_IA32 | 4167 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |