OLD | NEW |
---|---|
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 11 matching lines...) Expand all Loading... | |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 28 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
29 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 29 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
30 | 30 |
31 #include "assembler.h" | 31 #include "assembler.h" |
32 #include "type-info.h" | |
32 | 33 |
33 namespace v8 { | 34 namespace v8 { |
34 namespace internal { | 35 namespace internal { |
35 | 36 |
36 // Flags used for the AllocateInNewSpace functions. | 37 // Flags used for the AllocateInNewSpace functions. |
37 enum AllocationFlags { | 38 enum AllocationFlags { |
38 // No special flags. | 39 // No special flags. |
39 NO_ALLOCATION_FLAGS = 0, | 40 NO_ALLOCATION_FLAGS = 0, |
40 // Return the pointer to the allocated already tagged as a heap object. | 41 // Return the pointer to the allocated already tagged as a heap object. |
41 TAG_OBJECT = 1 << 0, | 42 TAG_OBJECT = 1 << 0, |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 // Smi tagging support. | 219 // Smi tagging support. |
219 void SmiTag(Register reg) { | 220 void SmiTag(Register reg) { |
220 ASSERT(kSmiTag == 0); | 221 ASSERT(kSmiTag == 0); |
221 ASSERT(kSmiTagSize == 1); | 222 ASSERT(kSmiTagSize == 1); |
222 add(reg, Operand(reg)); | 223 add(reg, Operand(reg)); |
223 } | 224 } |
224 void SmiUntag(Register reg) { | 225 void SmiUntag(Register reg) { |
225 sar(reg, kSmiTagSize); | 226 sar(reg, kSmiTagSize); |
226 } | 227 } |
227 | 228 |
229 void SmiUntagAndBranchOnNonSmi(Register reg, TypeInfo info, Label* non_smi) { | |
Lasse Reichstein
2010/08/06 08:20:12
In X64 I've been naming functions like this just S
Lasse Reichstein
2010/08/06 08:20:12
Do comment that this function is destructive.
Erik Corry
2010/08/09 13:13:49
Done.
Erik Corry
2010/08/09 13:13:49
Done.
| |
230 ASSERT(kSmiTagSize == 1); | |
231 sar(reg, kSmiTagSize); | |
232 if (info.IsSmi()) { | |
233 ASSERT(kSmiTag == 0); | |
234 j(carry, non_smi); | |
235 } | |
236 } | |
237 | |
238 void SmiUntagAndBranchOnSmi(Register reg, Label* is_smi) { | |
239 ASSERT(kSmiTagSize == 1); | |
240 sar(reg, kSmiTagSize); | |
241 ASSERT(kSmiTag == 0); | |
242 j(not_carry, is_smi); | |
243 } | |
244 | |
245 // Assumes input is a heap object. | |
246 void JumpIfNotNumber(Register reg, TypeInfo info, Label* on_not_number); | |
247 | |
248 // Assumes input is a heap number. Jumps on things out of range. Also jumps | |
249 // on the min negative int32. Ignores frational parts. | |
Lasse Reichstein
2010/08/06 08:20:12
As stated otherwhere, the name doesn't match the f
Erik Corry
2010/08/09 13:13:49
Renamed.
| |
250 void JumpIfNotInt32(Register reg, | |
251 Register scratch, | |
252 TypeInfo info, | |
253 Label* on_not_int32); | |
254 | |
228 // Abort execution if argument is not a number. Used in debug code. | 255 // Abort execution if argument is not a number. Used in debug code. |
229 void AbortIfNotNumber(Register object); | 256 void AbortIfNotNumber(Register object); |
230 | 257 |
231 // Abort execution if argument is not a smi. Used in debug code. | 258 // Abort execution if argument is not a smi. Used in debug code. |
232 void AbortIfNotSmi(Register object); | 259 void AbortIfNotSmi(Register object); |
233 | 260 |
261 // Abort execution if argument is a smi. Used in debug code. | |
262 void AbortIfSmi(Register object); | |
263 | |
234 // --------------------------------------------------------------------------- | 264 // --------------------------------------------------------------------------- |
235 // Exception handling | 265 // Exception handling |
236 | 266 |
237 // Push a new try handler and link into try handler chain. The return | 267 // Push a new try handler and link into try handler chain. The return |
238 // address must be pushed before calling this helper. | 268 // address must be pushed before calling this helper. |
239 void PushTryHandler(CodeLocation try_location, HandlerType type); | 269 void PushTryHandler(CodeLocation try_location, HandlerType type); |
240 | 270 |
241 // Unlink the stack handler on top of the stack from the try handler chain. | 271 // Unlink the stack handler on top of the stack from the try handler chain. |
242 void PopTryHandler(); | 272 void PopTryHandler(); |
243 | 273 |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 } \ | 631 } \ |
602 masm-> | 632 masm-> |
603 #else | 633 #else |
604 #define ACCESS_MASM(masm) masm-> | 634 #define ACCESS_MASM(masm) masm-> |
605 #endif | 635 #endif |
606 | 636 |
607 | 637 |
608 } } // namespace v8::internal | 638 } } // namespace v8::internal |
609 | 639 |
610 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 640 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |