| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3102 case Token::NOT: | 3102 case Token::NOT: |
| 3103 case Token::DELETE: | 3103 case Token::DELETE: |
| 3104 case Token::TYPEOF: | 3104 case Token::TYPEOF: |
| 3105 UNREACHABLE(); // handled above | 3105 UNREACHABLE(); // handled above |
| 3106 break; | 3106 break; |
| 3107 | 3107 |
| 3108 case Token::SUB: { | 3108 case Token::SUB: { |
| 3109 bool overwrite = | 3109 bool overwrite = |
| 3110 (node->expression()->AsBinaryOperation() != NULL && | 3110 (node->expression()->AsBinaryOperation() != NULL && |
| 3111 node->expression()->AsBinaryOperation()->ResultOverwriteAllowed()); | 3111 node->expression()->AsBinaryOperation()->ResultOverwriteAllowed()); |
| 3112 UnarySubStub stub(overwrite); | 3112 GenericUnaryOpStub stub(Token::SUB, overwrite); |
| 3113 // TODO(1222589): remove dependency of TOS being cached inside stub | 3113 // TODO(1222589): remove dependency of TOS being cached inside stub |
| 3114 Result operand = frame_->Pop(); | 3114 Result operand = frame_->Pop(); |
| 3115 Result answer = frame_->CallStub(&stub, &operand); | 3115 Result answer = frame_->CallStub(&stub, &operand); |
| 3116 frame_->Push(&answer); | 3116 frame_->Push(&answer); |
| 3117 break; | 3117 break; |
| 3118 } | 3118 } |
| 3119 | 3119 |
| 3120 case Token::BIT_NOT: { | 3120 case Token::BIT_NOT: { |
| 3121 // Smi check. | 3121 // Smi check. |
| 3122 JumpTarget smi_label; | 3122 JumpTarget smi_label; |
| (...skipping 3142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6265 if (answer_object == Heap::undefined_value()) { | 6265 if (answer_object == Heap::undefined_value()) { |
| 6266 return false; | 6266 return false; |
| 6267 } | 6267 } |
| 6268 frame_->Push(Handle<Object>(answer_object)); | 6268 frame_->Push(Handle<Object>(answer_object)); |
| 6269 return true; | 6269 return true; |
| 6270 } | 6270 } |
| 6271 | 6271 |
| 6272 | 6272 |
| 6273 // End of CodeGenerator implementation. | 6273 // End of CodeGenerator implementation. |
| 6274 | 6274 |
| 6275 void UnarySubStub::Generate(MacroAssembler* masm) { | 6275 void GenericUnaryOpStub::Generate(MacroAssembler* masm) { |
| 6276 ASSERT(op_ == Token::SUB); |
| 6277 |
| 6276 Label slow; | 6278 Label slow; |
| 6277 Label done; | 6279 Label done; |
| 6278 Label try_float; | 6280 Label try_float; |
| 6279 // Check whether the value is a smi. | 6281 // Check whether the value is a smi. |
| 6280 __ JumpIfNotSmi(rax, &try_float); | 6282 __ JumpIfNotSmi(rax, &try_float); |
| 6281 | 6283 |
| 6282 // Enter runtime system if the value of the smi is zero | 6284 // Enter runtime system if the value of the smi is zero |
| 6283 // to make sure that we switch between 0 and -0. | 6285 // to make sure that we switch between 0 and -0. |
| 6284 // Also enter it if the value of the smi is Smi::kMinValue. | 6286 // Also enter it if the value of the smi is Smi::kMinValue. |
| 6285 __ SmiNeg(rax, rax, &done); | 6287 __ SmiNeg(rax, rax, &done); |
| (...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8141 masm.GetCode(&desc); | 8143 masm.GetCode(&desc); |
| 8142 // Call the function from C++. | 8144 // Call the function from C++. |
| 8143 return FUNCTION_CAST<ModuloFunction>(buffer); | 8145 return FUNCTION_CAST<ModuloFunction>(buffer); |
| 8144 } | 8146 } |
| 8145 | 8147 |
| 8146 #endif | 8148 #endif |
| 8147 | 8149 |
| 8148 #undef __ | 8150 #undef __ |
| 8149 | 8151 |
| 8150 } } // namespace v8::internal | 8152 } } // namespace v8::internal |
| OLD | NEW |