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

Side by Side Diff: runtime/vm/assembler_ia32.cc

Issue 313083008: Add LoadTaggedClassIdMayBeSmi to assembly and improve performance of inline cache stubs. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_mips.h » ('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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after
2649 2649
2650 2650
2651 void Assembler::CompareClassId(Register object, 2651 void Assembler::CompareClassId(Register object,
2652 intptr_t class_id, 2652 intptr_t class_id,
2653 Register scratch) { 2653 Register scratch) {
2654 LoadClassId(scratch, object); 2654 LoadClassId(scratch, object);
2655 cmpl(scratch, Immediate(class_id)); 2655 cmpl(scratch, Immediate(class_id));
2656 } 2656 }
2657 2657
2658 2658
2659 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) {
2660 testl(object, Immediate(kSmiTagMask));
2661 Label not_smi, done;
2662 j(NOT_ZERO, &not_smi, Assembler::kNearJump);
2663 movl(result, Immediate(Smi::RawValue(kSmiCid)));
2664 jmp(&done, Assembler::kNearJump);
2665 Bind(&not_smi);
2666 LoadClassId(result, object);
2667 SmiTag(result);
2668 Bind(&done);
2669 }
2670
2671
2659 static const char* cpu_reg_names[kNumberOfCpuRegisters] = { 2672 static const char* cpu_reg_names[kNumberOfCpuRegisters] = {
2660 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi" 2673 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"
2661 }; 2674 };
2662 2675
2663 2676
2664 const char* Assembler::RegisterName(Register reg) { 2677 const char* Assembler::RegisterName(Register reg) {
2665 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters)); 2678 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters));
2666 return cpu_reg_names[reg]; 2679 return cpu_reg_names[reg];
2667 } 2680 }
2668 2681
2669 2682
2670 static const char* xmm_reg_names[kNumberOfXmmRegisters] = { 2683 static const char* xmm_reg_names[kNumberOfXmmRegisters] = {
2671 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" 2684 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
2672 }; 2685 };
2673 2686
2674 2687
2675 const char* Assembler::FpuRegisterName(FpuRegister reg) { 2688 const char* Assembler::FpuRegisterName(FpuRegister reg) {
2676 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 2689 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
2677 return xmm_reg_names[reg]; 2690 return xmm_reg_names[reg];
2678 } 2691 }
2679 2692
2680 2693
2681 } // namespace dart 2694 } // namespace dart
2682 2695
2683 #endif // defined TARGET_ARCH_IA32 2696 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698