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

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

Issue 7048003: Improve bit tests on IA32. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 7 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 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Compute the page start address from the heap object pointer, and reuse 66 // Compute the page start address from the heap object pointer, and reuse
67 // the 'object' register for it. 67 // the 'object' register for it.
68 and_(object, ~Page::kPageAlignmentMask); 68 and_(object, ~Page::kPageAlignmentMask);
69 69
70 // Compute number of region covering addr. See Page::GetRegionNumberForAddress 70 // Compute number of region covering addr. See Page::GetRegionNumberForAddress
71 // method for more details. 71 // method for more details.
72 and_(addr, Page::kPageAlignmentMask); 72 and_(addr, Page::kPageAlignmentMask);
73 shr(addr, Page::kRegionSizeLog2); 73 shr(addr, Page::kRegionSizeLog2);
74 74
75 // Set dirty mark for region. 75 // Set dirty mark for region.
76 bts(Operand(object, Page::kDirtyFlagOffset), addr); 76 // Bit tests with a memory operand should be avoided on Intel processors,
77 // as they usually have long latency and multiple uops. We load the bit base
78 // operand to a register at first and store it back after bit set.
79 mov(scratch, Operand(object, Page::kDirtyFlagOffset));
80 bts(Operand(scratch), addr);
81 mov(Operand(object, Page::kDirtyFlagOffset), scratch);
77 } 82 }
78 83
79 84
80 void MacroAssembler::ClampDoubleToUint8(XMMRegister input_reg, 85 void MacroAssembler::ClampDoubleToUint8(XMMRegister input_reg,
81 XMMRegister scratch_reg, 86 XMMRegister scratch_reg,
82 Register result_reg) { 87 Register result_reg) {
83 Label done; 88 Label done;
84 ExternalReference zero_ref = ExternalReference::address_of_zero(); 89 ExternalReference zero_ref = ExternalReference::address_of_zero();
85 movdbl(scratch_reg, Operand::StaticVariable(zero_ref)); 90 movdbl(scratch_reg, Operand::StaticVariable(zero_ref));
86 Set(result_reg, Immediate(0)); 91 Set(result_reg, Immediate(0));
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 2088
2084 // Check that the code was patched as expected. 2089 // Check that the code was patched as expected.
2085 ASSERT(masm_.pc_ == address_ + size_); 2090 ASSERT(masm_.pc_ == address_ + size_);
2086 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2091 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2087 } 2092 }
2088 2093
2089 2094
2090 } } // namespace v8::internal 2095 } } // namespace v8::internal
2091 2096
2092 #endif // V8_TARGET_ARCH_IA32 2097 #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