| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 8248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8259 if (in_safe_int32_mode()) { | 8259 if (in_safe_int32_mode()) { |
| 8260 Visit(node->expression()); | 8260 Visit(node->expression()); |
| 8261 Result value = frame_->Pop(); | 8261 Result value = frame_->Pop(); |
| 8262 ASSERT(value.is_untagged_int32()); | 8262 ASSERT(value.is_untagged_int32()); |
| 8263 // Registers containing an int32 value are not multiply used. | 8263 // Registers containing an int32 value are not multiply used. |
| 8264 ASSERT(!value.is_register() || !frame_->is_used(value.reg())); | 8264 ASSERT(!value.is_register() || !frame_->is_used(value.reg())); |
| 8265 value.ToRegister(); | 8265 value.ToRegister(); |
| 8266 switch (op) { | 8266 switch (op) { |
| 8267 case Token::SUB: { | 8267 case Token::SUB: { |
| 8268 __ neg(value.reg()); | 8268 __ neg(value.reg()); |
| 8269 frame_->Push(&value); |
| 8269 if (node->no_negative_zero()) { | 8270 if (node->no_negative_zero()) { |
| 8270 // -MIN_INT is MIN_INT with the overflow flag set. | 8271 // -MIN_INT is MIN_INT with the overflow flag set. |
| 8271 unsafe_bailout_->Branch(overflow); | 8272 unsafe_bailout_->Branch(overflow); |
| 8272 } else { | 8273 } else { |
| 8273 // MIN_INT and 0 both have bad negations. They both have 31 zeros. | 8274 // MIN_INT and 0 both have bad negations. They both have 31 zeros. |
| 8274 __ test(value.reg(), Immediate(0x7FFFFFFF)); | 8275 __ test(value.reg(), Immediate(0x7FFFFFFF)); |
| 8275 unsafe_bailout_->Branch(zero); | 8276 unsafe_bailout_->Branch(zero); |
| 8276 } | 8277 } |
| 8277 break; | 8278 break; |
| 8278 } | 8279 } |
| 8279 case Token::BIT_NOT: { | 8280 case Token::BIT_NOT: { |
| 8280 __ not_(value.reg()); | 8281 __ not_(value.reg()); |
| 8282 frame_->Push(&value); |
| 8281 break; | 8283 break; |
| 8282 } | 8284 } |
| 8283 case Token::ADD: { | 8285 case Token::ADD: { |
| 8284 // Unary plus has no effect on int32 values. | 8286 // Unary plus has no effect on int32 values. |
| 8287 frame_->Push(&value); |
| 8285 break; | 8288 break; |
| 8286 } | 8289 } |
| 8287 default: | 8290 default: |
| 8288 UNREACHABLE(); | 8291 UNREACHABLE(); |
| 8289 break; | 8292 break; |
| 8290 } | 8293 } |
| 8291 frame_->Push(&value); | |
| 8292 } else { | 8294 } else { |
| 8293 Load(node->expression()); | 8295 Load(node->expression()); |
| 8294 bool can_overwrite = node->expression()->ResultOverwriteAllowed(); | 8296 bool can_overwrite = node->expression()->ResultOverwriteAllowed(); |
| 8295 UnaryOverwriteMode overwrite = | 8297 UnaryOverwriteMode overwrite = |
| 8296 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; | 8298 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; |
| 8297 bool no_negative_zero = node->expression()->no_negative_zero(); | 8299 bool no_negative_zero = node->expression()->no_negative_zero(); |
| 8298 switch (op) { | 8300 switch (op) { |
| 8299 case Token::NOT: | 8301 case Token::NOT: |
| 8300 case Token::DELETE: | 8302 case Token::DELETE: |
| 8301 case Token::TYPEOF: | 8303 case Token::TYPEOF: |
| (...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10279 masm.GetCode(&desc); | 10281 masm.GetCode(&desc); |
| 10280 // Call the function from C++. | 10282 // Call the function from C++. |
| 10281 return FUNCTION_CAST<MemCopyFunction>(buffer); | 10283 return FUNCTION_CAST<MemCopyFunction>(buffer); |
| 10282 } | 10284 } |
| 10283 | 10285 |
| 10284 #undef __ | 10286 #undef __ |
| 10285 | 10287 |
| 10286 } } // namespace v8::internal | 10288 } } // namespace v8::internal |
| 10287 | 10289 |
| 10288 #endif // V8_TARGET_ARCH_IA32 | 10290 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |