OLD | NEW |
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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 __ mov(argument, Operand(esp, 1 * kPointerSize)); | 248 __ mov(argument, Operand(esp, 1 * kPointerSize)); |
249 } | 249 } |
250 | 250 |
251 // undefined -> false | 251 // undefined -> false |
252 CheckOddball(masm, UNDEFINED, Heap::kUndefinedValueRootIndex, false, &patch); | 252 CheckOddball(masm, UNDEFINED, Heap::kUndefinedValueRootIndex, false, &patch); |
253 | 253 |
254 // Boolean -> its value | 254 // Boolean -> its value |
255 CheckOddball(masm, BOOLEAN, Heap::kFalseValueRootIndex, false, &patch); | 255 CheckOddball(masm, BOOLEAN, Heap::kFalseValueRootIndex, false, &patch); |
256 CheckOddball(masm, BOOLEAN, Heap::kTrueValueRootIndex, true, &patch); | 256 CheckOddball(masm, BOOLEAN, Heap::kTrueValueRootIndex, true, &patch); |
257 | 257 |
258 // 'null' -> false.!!! | 258 // 'null' -> false. |
259 CheckOddball(masm, NULL_TYPE, Heap::kNullValueRootIndex, false, &patch); | 259 CheckOddball(masm, NULL_TYPE, Heap::kNullValueRootIndex, false, &patch); |
260 | 260 |
261 if (types_.Contains(SMI)) { | 261 if (types_.Contains(SMI)) { |
262 // Smis: 0 -> false, all other -> true | 262 // Smis: 0 -> false, all other -> true |
263 Label not_smi; | 263 Label not_smi; |
264 __ JumpIfNotSmi(argument, ¬_smi, Label::kNear); | 264 __ JumpIfNotSmi(argument, ¬_smi, Label::kNear); |
265 // argument contains the correct return value already | 265 // argument contains the correct return value already |
266 if (!tos_.is(argument)) { | 266 if (!tos_.is(argument)) { |
267 __ mov(tos_, argument); | 267 __ mov(tos_, argument); |
268 } | 268 } |
(...skipping 6108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6377 __ Drop(1); | 6377 __ Drop(1); |
6378 __ ret(2 * kPointerSize); | 6378 __ ret(2 * kPointerSize); |
6379 } | 6379 } |
6380 | 6380 |
6381 | 6381 |
6382 #undef __ | 6382 #undef __ |
6383 | 6383 |
6384 } } // namespace v8::internal | 6384 } } // namespace v8::internal |
6385 | 6385 |
6386 #endif // V8_TARGET_ARCH_IA32 | 6386 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |