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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 7248063: Simplify UnaryOpStub a little bit. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 5 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 | « src/ia32/code-stubs-ia32.h ('k') | src/ic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 break; 547 break;
548 case UnaryOpIC::GENERIC: 548 case UnaryOpIC::GENERIC:
549 GenerateGenericStub(masm); 549 GenerateGenericStub(masm);
550 break; 550 break;
551 } 551 }
552 } 552 }
553 553
554 554
555 void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) { 555 void UnaryOpStub::GenerateTypeTransition(MacroAssembler* masm) {
556 __ pop(ecx); // Save return address. 556 __ pop(ecx); // Save return address.
557 __ push(eax); 557
558 // the argument is now on top. 558 __ push(eax); // the operand
559 // Push this stub's key. Although the operation and the type info are
560 // encoded into the key, the encoding is opaque, so push them too.
561 __ push(Immediate(Smi::FromInt(MinorKey())));
562 __ push(Immediate(Smi::FromInt(op_))); 559 __ push(Immediate(Smi::FromInt(op_)));
560 __ push(Immediate(Smi::FromInt(mode_)));
563 __ push(Immediate(Smi::FromInt(operand_type_))); 561 __ push(Immediate(Smi::FromInt(operand_type_)));
564 562
565 __ push(ecx); // Push return address. 563 __ push(ecx); // Push return address.
566 564
567 // Patch the caller to an appropriate specialized stub and return the 565 // Patch the caller to an appropriate specialized stub and return the
568 // operation result to the caller of the stub. 566 // operation result to the caller of the stub.
569 __ TailCallExternalReference( 567 __ TailCallExternalReference(
570 ExternalReference(IC_Utility(IC::kUnaryOp_Patch), 568 ExternalReference(IC_Utility(IC::kUnaryOp_Patch), masm->isolate()), 4, 1);
571 masm->isolate()), 4, 1);
572 } 569 }
573 570
574 571
575 // TODO(svenpanne): Use virtual functions instead of switch. 572 // TODO(svenpanne): Use virtual functions instead of switch.
576 void UnaryOpStub::GenerateSmiStub(MacroAssembler* masm) { 573 void UnaryOpStub::GenerateSmiStub(MacroAssembler* masm) {
577 switch (op_) { 574 switch (op_) {
578 case Token::SUB: 575 case Token::SUB:
579 GenerateSmiStubSub(masm); 576 GenerateSmiStubSub(masm);
580 break; 577 break;
581 case Token::BIT_NOT: 578 case Token::BIT_NOT:
(...skipping 5766 matching lines...) Expand 10 before | Expand all | Expand 10 after
6348 __ Drop(1); 6345 __ Drop(1);
6349 __ ret(2 * kPointerSize); 6346 __ ret(2 * kPointerSize);
6350 } 6347 }
6351 6348
6352 6349
6353 #undef __ 6350 #undef __
6354 6351
6355 } } // namespace v8::internal 6352 } } // namespace v8::internal
6356 6353
6357 #endif // V8_TARGET_ARCH_IA32 6354 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.h ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698