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

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

Issue 10778029: Allow uint32 value on optimized frames if they are consumed by safe operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: arm and x64 ports Created 8 years, 4 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 void MacroAssembler::ClampUint8(Register reg) { 148 void MacroAssembler::ClampUint8(Register reg) {
149 Label done; 149 Label done;
150 test(reg, Immediate(0xFFFFFF00)); 150 test(reg, Immediate(0xFFFFFF00));
151 j(zero, &done, Label::kNear); 151 j(zero, &done, Label::kNear);
152 setcc(negative, reg); // 1 if negative, 0 if positive. 152 setcc(negative, reg); // 1 if negative, 0 if positive.
153 dec_b(reg); // 0 if negative, 255 if positive. 153 dec_b(reg); // 0 if negative, 255 if positive.
154 bind(&done); 154 bind(&done);
155 } 155 }
156 156
157 157
158 static double kUint32Bias =
159 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1;
160
161
162 void MacroAssembler::LoadUint32(XMMRegister dst,
163 Register src,
164 XMMRegister scratch) {
165 Label done;
166 cmp(src, Immediate(0));
167 movdbl(scratch,
168 Operand(reinterpret_cast<int32_t>(&kUint32Bias), RelocInfo::NONE));
169 cvtsi2sd(dst, src);
170 j(not_sign, &done, Label::kNear);
171 addsd(dst, scratch);
172 bind(&done);
173 }
174
175
158 void MacroAssembler::RecordWriteArray(Register object, 176 void MacroAssembler::RecordWriteArray(Register object,
159 Register value, 177 Register value,
160 Register index, 178 Register index,
161 SaveFPRegsMode save_fp, 179 SaveFPRegsMode save_fp,
162 RememberedSetAction remembered_set_action, 180 RememberedSetAction remembered_set_action,
163 SmiCheck smi_check) { 181 SmiCheck smi_check) {
164 // First, check if a write barrier is even needed. The tests below 182 // First, check if a write barrier is even needed. The tests below
165 // catch stores of Smis. 183 // catch stores of Smis.
166 Label done; 184 Label done;
167 185
(...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after
2921 // Load the prototype from the map and loop if non-null. 2939 // Load the prototype from the map and loop if non-null.
2922 bind(&check_prototype); 2940 bind(&check_prototype);
2923 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); 2941 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
2924 cmp(ecx, isolate()->factory()->null_value()); 2942 cmp(ecx, isolate()->factory()->null_value());
2925 j(not_equal, &next); 2943 j(not_equal, &next);
2926 } 2944 }
2927 2945
2928 } } // namespace v8::internal 2946 } } // namespace v8::internal
2929 2947
2930 #endif // V8_TARGET_ARCH_IA32 2948 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698