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

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

Issue 8081016: Shorter opcodes in ia32 in some cases where register is wrapped in an operand. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: minor change. Created 9 years, 2 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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 450 }
451 451
452 452
453 void Assembler::push(Register src) { 453 void Assembler::push(Register src) {
454 EnsureSpace ensure_space(this); 454 EnsureSpace ensure_space(this);
455 EMIT(0x50 | src.code()); 455 EMIT(0x50 | src.code());
456 } 456 }
457 457
458 458
459 void Assembler::push(const Operand& src) { 459 void Assembler::push(const Operand& src) {
460 if (src.is_reg_only()) {
461 push(src.reg());
462 return;
463 }
460 EnsureSpace ensure_space(this); 464 EnsureSpace ensure_space(this);
461 EMIT(0xFF); 465 EMIT(0xFF);
462 emit_operand(esi, src); 466 emit_operand(esi, src);
463 } 467 }
464 468
465 469
466 void Assembler::push(Handle<Object> handle) { 470 void Assembler::push(Handle<Object> handle) {
467 EnsureSpace ensure_space(this); 471 EnsureSpace ensure_space(this);
468 EMIT(0x68); 472 EMIT(0x68);
469 emit(handle); 473 emit(handle);
470 } 474 }
471 475
472 476
473 void Assembler::pop(Register dst) { 477 void Assembler::pop(Register dst) {
474 ASSERT(reloc_info_writer.last_pc() != NULL); 478 ASSERT(reloc_info_writer.last_pc() != NULL);
475 EnsureSpace ensure_space(this); 479 EnsureSpace ensure_space(this);
476 EMIT(0x58 | dst.code()); 480 EMIT(0x58 | dst.code());
477 } 481 }
478 482
479 483
480 void Assembler::pop(const Operand& dst) { 484 void Assembler::pop(const Operand& dst) {
485 if (dst.is_reg_only()) {
486 pop(dst.reg());
487 return;
488 }
481 EnsureSpace ensure_space(this); 489 EnsureSpace ensure_space(this);
482 EMIT(0x8F); 490 EMIT(0x8F);
483 emit_operand(eax, dst); 491 emit_operand(eax, dst);
484 } 492 }
485 493
486 494
487 void Assembler::enter(const Immediate& size) { 495 void Assembler::enter(const Immediate& size) {
488 EnsureSpace ensure_space(this); 496 EnsureSpace ensure_space(this);
489 EMIT(0xC8); 497 EMIT(0xC8);
490 emit_w(size); 498 emit_w(size);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 561
554 562
555 void Assembler::mov(Register dst, Handle<Object> handle) { 563 void Assembler::mov(Register dst, Handle<Object> handle) {
556 EnsureSpace ensure_space(this); 564 EnsureSpace ensure_space(this);
557 EMIT(0xB8 | dst.code()); 565 EMIT(0xB8 | dst.code());
558 emit(handle); 566 emit(handle);
559 } 567 }
560 568
561 569
562 void Assembler::mov(Register dst, const Operand& src) { 570 void Assembler::mov(Register dst, const Operand& src) {
571 if (src.is_reg_only()) {
572 mov(dst, src.reg());
573 return;
574 }
563 EnsureSpace ensure_space(this); 575 EnsureSpace ensure_space(this);
564 EMIT(0x8B); 576 EMIT(0x8B);
565 emit_operand(dst, src); 577 emit_operand(dst, src);
566 } 578 }
567 579
568 580
569 void Assembler::mov(Register dst, Register src) { 581 void Assembler::mov(Register dst, Register src) {
570 EnsureSpace ensure_space(this); 582 EnsureSpace ensure_space(this);
571 EMIT(0x89); 583 EMIT(0x89);
572 EMIT(0xC0 | src.code() << 3 | dst.code()); 584 EMIT(0xC0 | src.code() << 3 | dst.code());
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 } 870 }
859 871
860 872
861 void Assembler::dec(Register dst) { 873 void Assembler::dec(Register dst) {
862 EnsureSpace ensure_space(this); 874 EnsureSpace ensure_space(this);
863 EMIT(0x48 | dst.code()); 875 EMIT(0x48 | dst.code());
864 } 876 }
865 877
866 878
867 void Assembler::dec(const Operand& dst) { 879 void Assembler::dec(const Operand& dst) {
880 if (dst.is_reg_only()) {
881 dec(dst.reg());
882 return;
883 }
868 EnsureSpace ensure_space(this); 884 EnsureSpace ensure_space(this);
869 EMIT(0xFF); 885 EMIT(0xFF);
870 emit_operand(ecx, dst); 886 emit_operand(ecx, dst);
871 } 887 }
872 888
873 889
874 void Assembler::cdq() { 890 void Assembler::cdq() {
875 EnsureSpace ensure_space(this); 891 EnsureSpace ensure_space(this);
876 EMIT(0x99); 892 EMIT(0x99);
877 } 893 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 } 929 }
914 930
915 931
916 void Assembler::inc(Register dst) { 932 void Assembler::inc(Register dst) {
917 EnsureSpace ensure_space(this); 933 EnsureSpace ensure_space(this);
918 EMIT(0x40 | dst.code()); 934 EMIT(0x40 | dst.code());
919 } 935 }
920 936
921 937
922 void Assembler::inc(const Operand& dst) { 938 void Assembler::inc(const Operand& dst) {
939 if (dst.is_reg_only()) {
940 inc(dst.reg());
941 return;
942 }
923 EnsureSpace ensure_space(this); 943 EnsureSpace ensure_space(this);
924 EMIT(0xFF); 944 EMIT(0xFF);
925 emit_operand(eax, dst); 945 emit_operand(eax, dst);
926 } 946 }
927 947
928 948
929 void Assembler::lea(Register dst, const Operand& src) { 949 void Assembler::lea(Register dst, const Operand& src) {
930 EnsureSpace ensure_space(this); 950 EnsureSpace ensure_space(this);
931 EMIT(0x8D); 951 EMIT(0x8D);
932 emit_operand(dst, src); 952 emit_operand(dst, src);
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 fprintf(coverage_log, "%s\n", file_line); 2526 fprintf(coverage_log, "%s\n", file_line);
2507 fflush(coverage_log); 2527 fflush(coverage_log);
2508 } 2528 }
2509 } 2529 }
2510 2530
2511 #endif 2531 #endif
2512 2532
2513 } } // namespace v8::internal 2533 } } // namespace v8::internal
2514 2534
2515 #endif // V8_TARGET_ARCH_IA32 2535 #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