OLD | NEW |
1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 3076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3088 MathPowStub stub(MathPowStub::INTEGER); | 3088 MathPowStub stub(MathPowStub::INTEGER); |
3089 __ CallStub(&stub); | 3089 __ CallStub(&stub); |
3090 } else { | 3090 } else { |
3091 ASSERT(exponent_type.IsDouble()); | 3091 ASSERT(exponent_type.IsDouble()); |
3092 MathPowStub stub(MathPowStub::DOUBLE); | 3092 MathPowStub stub(MathPowStub::DOUBLE); |
3093 __ CallStub(&stub); | 3093 __ CallStub(&stub); |
3094 } | 3094 } |
3095 } | 3095 } |
3096 | 3096 |
3097 | 3097 |
| 3098 void LCodeGen::DoRandom(LRandom* instr) { |
| 3099 // Having marked this instruction as a call we can use any |
| 3100 // registers. |
| 3101 ASSERT(ToDoubleRegister(instr->result()).is(f0)); |
| 3102 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); |
| 3103 |
| 3104 __ PrepareCallCFunction(1, a1); |
| 3105 __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalContextOffset)); |
| 3106 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); |
| 3107 |
| 3108 // 0x41300000 is the top half of 1.0 x 2^20 as a double. |
| 3109 __ li(a2, Operand(0x41300000)); |
| 3110 // Move 0x41300000xxxxxxxx (x = random bits in v0) to FPU. |
| 3111 __ Move(f12, v0, a2); |
| 3112 // Move 0x4130000000000000 to FPU. |
| 3113 __ Move(f14, zero_reg, a2); |
| 3114 // Subtract to get the result. |
| 3115 __ sub_d(f0, f12, f14); |
| 3116 } |
| 3117 |
| 3118 |
3098 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { | 3119 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { |
3099 ASSERT(ToDoubleRegister(instr->result()).is(f4)); | 3120 ASSERT(ToDoubleRegister(instr->result()).is(f4)); |
3100 TranscendentalCacheStub stub(TranscendentalCache::LOG, | 3121 TranscendentalCacheStub stub(TranscendentalCache::LOG, |
3101 TranscendentalCacheStub::UNTAGGED); | 3122 TranscendentalCacheStub::UNTAGGED); |
3102 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3123 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3103 } | 3124 } |
3104 | 3125 |
3105 | 3126 |
3106 void LCodeGen::DoMathTan(LUnaryMathOperation* instr) { | 3127 void LCodeGen::DoMathTan(LUnaryMathOperation* instr) { |
3107 ASSERT(ToDoubleRegister(instr->result()).is(f4)); | 3128 ASSERT(ToDoubleRegister(instr->result()).is(f4)); |
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4685 ASSERT(!environment->HasBeenRegistered()); | 4706 ASSERT(!environment->HasBeenRegistered()); |
4686 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4707 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
4687 ASSERT(osr_pc_offset_ == -1); | 4708 ASSERT(osr_pc_offset_ == -1); |
4688 osr_pc_offset_ = masm()->pc_offset(); | 4709 osr_pc_offset_ = masm()->pc_offset(); |
4689 } | 4710 } |
4690 | 4711 |
4691 | 4712 |
4692 #undef __ | 4713 #undef __ |
4693 | 4714 |
4694 } } // namespace v8::internal | 4715 } } // namespace v8::internal |
OLD | NEW |