Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 6591070: Correctly maintain virtual frame in unary operations on ia32. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 8292 matching lines...) Expand 10 before | Expand all | Expand 10 after
8303 if (in_safe_int32_mode()) { 8303 if (in_safe_int32_mode()) {
8304 Visit(node->expression()); 8304 Visit(node->expression());
8305 Result value = frame_->Pop(); 8305 Result value = frame_->Pop();
8306 ASSERT(value.is_untagged_int32()); 8306 ASSERT(value.is_untagged_int32());
8307 // Registers containing an int32 value are not multiply used. 8307 // Registers containing an int32 value are not multiply used.
8308 ASSERT(!value.is_register() || !frame_->is_used(value.reg())); 8308 ASSERT(!value.is_register() || !frame_->is_used(value.reg()));
8309 value.ToRegister(); 8309 value.ToRegister();
8310 switch (op) { 8310 switch (op) {
8311 case Token::SUB: { 8311 case Token::SUB: {
8312 __ neg(value.reg()); 8312 __ neg(value.reg());
8313 frame_->Push(&value);
8313 if (node->no_negative_zero()) { 8314 if (node->no_negative_zero()) {
8314 // -MIN_INT is MIN_INT with the overflow flag set. 8315 // -MIN_INT is MIN_INT with the overflow flag set.
8315 unsafe_bailout_->Branch(overflow); 8316 unsafe_bailout_->Branch(overflow);
8316 } else { 8317 } else {
8317 // MIN_INT and 0 both have bad negations. They both have 31 zeros. 8318 // MIN_INT and 0 both have bad negations. They both have 31 zeros.
8318 __ test(value.reg(), Immediate(0x7FFFFFFF)); 8319 __ test(value.reg(), Immediate(0x7FFFFFFF));
8319 unsafe_bailout_->Branch(zero); 8320 unsafe_bailout_->Branch(zero);
8320 } 8321 }
8321 break; 8322 break;
8322 } 8323 }
8323 case Token::BIT_NOT: { 8324 case Token::BIT_NOT: {
8324 __ not_(value.reg()); 8325 __ not_(value.reg());
8326 frame_->Push(&value);
8325 break; 8327 break;
8326 } 8328 }
8327 case Token::ADD: { 8329 case Token::ADD: {
8328 // Unary plus has no effect on int32 values. 8330 // Unary plus has no effect on int32 values.
8331 frame_->Push(&value);
8329 break; 8332 break;
8330 } 8333 }
8331 default: 8334 default:
8332 UNREACHABLE(); 8335 UNREACHABLE();
8333 break; 8336 break;
8334 } 8337 }
8335 frame_->Push(&value);
8336 } else { 8338 } else {
8337 Load(node->expression()); 8339 Load(node->expression());
8338 bool can_overwrite = node->expression()->ResultOverwriteAllowed(); 8340 bool can_overwrite = node->expression()->ResultOverwriteAllowed();
8339 UnaryOverwriteMode overwrite = 8341 UnaryOverwriteMode overwrite =
8340 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; 8342 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE;
8341 bool no_negative_zero = node->expression()->no_negative_zero(); 8343 bool no_negative_zero = node->expression()->no_negative_zero();
8342 switch (op) { 8344 switch (op) {
8343 case Token::NOT: 8345 case Token::NOT:
8344 case Token::DELETE: 8346 case Token::DELETE:
8345 case Token::TYPEOF: 8347 case Token::TYPEOF:
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
10334 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); 10336 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
10335 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); 10337 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
10336 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); 10338 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
10337 } 10339 }
10338 10340
10339 #undef __ 10341 #undef __
10340 10342
10341 } } // namespace v8::internal 10343 } } // namespace v8::internal
10342 10344
10343 #endif // V8_TARGET_ARCH_IA32 10345 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698