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

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

Issue 6015011: Use the macro assembler Set instead of explicit xor for clearing registers. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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/regexp-macro-assembler-ia32.cc ('k') | src/x64/builtins-x64.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 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 __ pop(rax); 67 __ pop(rax);
68 __ movq(rdx, rax); 68 __ movq(rdx, rax);
69 __ xor_(rax, Immediate(0x200000)); // Flip bit 21. 69 __ xor_(rax, Immediate(0x200000)); // Flip bit 21.
70 __ push(rax); 70 __ push(rax);
71 __ popfq(); 71 __ popfq();
72 __ pushfq(); 72 __ pushfq();
73 __ pop(rax); 73 __ pop(rax);
74 __ xor_(rax, rdx); // Different if CPUID is supported. 74 __ xor_(rax, rdx); // Different if CPUID is supported.
75 __ j(not_zero, &cpuid); 75 __ j(not_zero, &cpuid);
76 76
77 // CPUID not supported. Clear the supported features in edx:eax. 77 // CPUID not supported. Clear the supported features in rax.
78 __ xor_(rax, rax); 78 __ xor_(rax, rax);
79 __ jmp(&done); 79 __ jmp(&done);
80 80
81 // Invoke CPUID with 1 in eax to get feature information in 81 // Invoke CPUID with 1 in eax to get feature information in
82 // ecx:edx. Temporarily enable CPUID support because we know it's 82 // ecx:edx. Temporarily enable CPUID support because we know it's
83 // safe here. 83 // safe here.
84 __ bind(&cpuid); 84 __ bind(&cpuid);
85 __ movq(rax, Immediate(1)); 85 __ movq(rax, Immediate(1));
86 supported_ = kDefaultCpuFeatures | (1 << CPUID); 86 supported_ = kDefaultCpuFeatures | (1 << CPUID);
87 { Scope fscope(CPUID); 87 { Scope fscope(CPUID);
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 // specially coded on x64 means that it is a relative 32 bit address, as used 2987 // specially coded on x64 means that it is a relative 32 bit address, as used
2988 // by branch instructions. 2988 // by branch instructions.
2989 return (1 << rmode_) & kApplyMask; 2989 return (1 << rmode_) & kApplyMask;
2990 } 2990 }
2991 2991
2992 2992
2993 2993
2994 } } // namespace v8::internal 2994 } } // namespace v8::internal
2995 2995
2996 #endif // V8_TARGET_ARCH_X64 2996 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698