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 3271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3282 | 3282 |
3283 // Heap number map check. | 3283 // Heap number map check. |
3284 __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset), | 3284 __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset), |
3285 Factory::heap_number_map()); | 3285 Factory::heap_number_map()); |
3286 __ j(equal, &heap_number); | 3286 __ j(equal, &heap_number); |
3287 | 3287 |
3288 __ cmp(input_reg, Factory::undefined_value()); | 3288 __ cmp(input_reg, Factory::undefined_value()); |
3289 DeoptimizeIf(not_equal, env); | 3289 DeoptimizeIf(not_equal, env); |
3290 | 3290 |
3291 // Convert undefined to NaN. | 3291 // Convert undefined to NaN. |
3292 __ push(input_reg); | 3292 ExternalReference nan = ExternalReference::address_of_nan(); |
3293 __ mov(input_reg, Factory::nan_value()); | 3293 __ movdbl(result_reg, Operand::StaticVariable(nan)); |
3294 __ movdbl(result_reg, FieldOperand(input_reg, HeapNumber::kValueOffset)); | |
3295 __ pop(input_reg); | |
3296 __ jmp(&done); | 3294 __ jmp(&done); |
3297 | 3295 |
3298 // Heap number to XMM conversion. | 3296 // Heap number to XMM conversion. |
3299 __ bind(&heap_number); | 3297 __ bind(&heap_number); |
3300 __ movdbl(result_reg, FieldOperand(input_reg, HeapNumber::kValueOffset)); | 3298 __ movdbl(result_reg, FieldOperand(input_reg, HeapNumber::kValueOffset)); |
3301 __ jmp(&done); | 3299 __ jmp(&done); |
3302 | 3300 |
3303 // Smi to XMM conversion | 3301 // Smi to XMM conversion |
3304 __ bind(&load_smi); | 3302 __ bind(&load_smi); |
3305 __ SmiUntag(input_reg); // Untag smi before converting to float. | 3303 __ SmiUntag(input_reg); // Untag smi before converting to float. |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3999 ASSERT(osr_pc_offset_ == -1); | 3997 ASSERT(osr_pc_offset_ == -1); |
4000 osr_pc_offset_ = masm()->pc_offset(); | 3998 osr_pc_offset_ = masm()->pc_offset(); |
4001 } | 3999 } |
4002 | 4000 |
4003 | 4001 |
4004 #undef __ | 4002 #undef __ |
4005 | 4003 |
4006 } } // namespace v8::internal | 4004 } } // namespace v8::internal |
4007 | 4005 |
4008 #endif // V8_TARGET_ARCH_IA32 | 4006 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |