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 4977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4988 FloatingPointHelper::AllocateHeapNumber(masm_, | 4988 FloatingPointHelper::AllocateHeapNumber(masm_, |
4989 call_runtime.entry_label(), | 4989 call_runtime.entry_label(), |
4990 scratch1.reg(), | 4990 scratch1.reg(), |
4991 scratch2.reg(), | 4991 scratch2.reg(), |
4992 heap_number.reg()); | 4992 heap_number.reg()); |
4993 scratch1.Unuse(); | 4993 scratch1.Unuse(); |
4994 scratch2.Unuse(); | 4994 scratch2.Unuse(); |
4995 | 4995 |
4996 // Store the result in the allocated heap number. | 4996 // Store the result in the allocated heap number. |
4997 __ fstp_d(FieldOperand(heap_number.reg(), HeapNumber::kValueOffset)); | 4997 __ fstp_d(FieldOperand(heap_number.reg(), HeapNumber::kValueOffset)); |
4998 // Pop the extra copy of the argument. | 4998 // Replace the extra copy of the argument with the result. |
4999 frame_->Pop(); | 4999 frame_->SetElementAt(0, &heap_number); |
5000 // Push the result on the frame. | |
5001 frame_->Push(&heap_number); | |
5002 heap_number.Unuse(); | |
5003 done.Jump(); | 5000 done.Jump(); |
5004 | 5001 |
5005 call_runtime.Bind(); | 5002 call_runtime.Bind(); |
5006 // Free ST(0) which was not popped before calling into the runtime. | 5003 // Free ST(0) which was not popped before calling into the runtime. |
5007 __ ffree(0); | 5004 __ ffree(0); |
5008 Result answer; | 5005 Result answer; |
5009 switch (op) { | 5006 switch (op) { |
5010 case SIN: | 5007 case SIN: |
5011 answer = frame_->CallRuntime(Runtime::kMath_sin, 1); | 5008 answer = frame_->CallRuntime(Runtime::kMath_sin, 1); |
5012 break; | 5009 break; |
(...skipping 2585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7598 | 7595 |
7599 // Slow-case: Go through the JavaScript implementation. | 7596 // Slow-case: Go through the JavaScript implementation. |
7600 __ bind(&slow); | 7597 __ bind(&slow); |
7601 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 7598 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
7602 } | 7599 } |
7603 | 7600 |
7604 | 7601 |
7605 #undef __ | 7602 #undef __ |
7606 | 7603 |
7607 } } // namespace v8::internal | 7604 } } // namespace v8::internal |
OLD | NEW |