| OLD | NEW |
| 1 // Copyright 2012 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 |
| (...skipping 2805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2816 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { | 2816 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
| 2817 __ LoadHeapObject(scratch0(), instr->hydrogen()->pairs()); | 2817 __ LoadHeapObject(scratch0(), instr->hydrogen()->pairs()); |
| 2818 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); | 2818 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); |
| 2819 // The context is the first argument. | 2819 // The context is the first argument. |
| 2820 __ Push(cp, scratch0(), scratch1()); | 2820 __ Push(cp, scratch0(), scratch1()); |
| 2821 CallRuntime(Runtime::kDeclareGlobals, 3, instr); | 2821 CallRuntime(Runtime::kDeclareGlobals, 3, instr); |
| 2822 } | 2822 } |
| 2823 | 2823 |
| 2824 | 2824 |
| 2825 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { | 2825 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { |
| 2826 Register context = ToRegister(instr->context()); | |
| 2827 Register result = ToRegister(instr->result()); | 2826 Register result = ToRegister(instr->result()); |
| 2828 __ lw(result, ContextOperand(cp, Context::GLOBAL_INDEX)); | 2827 __ lw(result, ContextOperand(cp, Context::GLOBAL_INDEX)); |
| 2829 } | 2828 } |
| 2830 | 2829 |
| 2831 | 2830 |
| 2832 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { | 2831 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { |
| 2833 Register global = ToRegister(instr->global()); | 2832 Register global = ToRegister(instr->global()); |
| 2834 Register result = ToRegister(instr->result()); | 2833 Register result = ToRegister(instr->result()); |
| 2835 __ lw(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset)); | 2834 __ lw(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset)); |
| 2836 } | 2835 } |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3203 __ lw(a1, FieldMemOperand(a2, ByteArray::kHeaderSize)); | 3202 __ lw(a1, FieldMemOperand(a2, ByteArray::kHeaderSize)); |
| 3204 __ Branch(deferred->entry(), eq, a1, Operand(zero_reg)); | 3203 __ Branch(deferred->entry(), eq, a1, Operand(zero_reg)); |
| 3205 // Load state[1]. | 3204 // Load state[1]. |
| 3206 __ lw(a0, FieldMemOperand(a2, ByteArray::kHeaderSize + kSeedSize)); | 3205 __ lw(a0, FieldMemOperand(a2, ByteArray::kHeaderSize + kSeedSize)); |
| 3207 // a1: state[0]. | 3206 // a1: state[0]. |
| 3208 // a0: state[1]. | 3207 // a0: state[1]. |
| 3209 | 3208 |
| 3210 // state[0] = 18273 * (state[0] & 0xFFFF) + (state[0] >> 16) | 3209 // state[0] = 18273 * (state[0] & 0xFFFF) + (state[0] >> 16) |
| 3211 __ And(a3, a1, Operand(0xFFFF)); | 3210 __ And(a3, a1, Operand(0xFFFF)); |
| 3212 __ li(t0, Operand(18273)); | 3211 __ li(t0, Operand(18273)); |
| 3213 __ mul(a3, a3, t0); | 3212 __ Mul(a3, a3, t0); |
| 3214 __ srl(a1, a1, 16); | 3213 __ srl(a1, a1, 16); |
| 3215 __ Addu(a1, a3, a1); | 3214 __ Addu(a1, a3, a1); |
| 3216 // Save state[0]. | 3215 // Save state[0]. |
| 3217 __ sw(a1, FieldMemOperand(a2, ByteArray::kHeaderSize)); | 3216 __ sw(a1, FieldMemOperand(a2, ByteArray::kHeaderSize)); |
| 3218 | 3217 |
| 3219 // state[1] = 36969 * (state[1] & 0xFFFF) + (state[1] >> 16) | 3218 // state[1] = 36969 * (state[1] & 0xFFFF) + (state[1] >> 16) |
| 3220 __ And(a3, a0, Operand(0xFFFF)); | 3219 __ And(a3, a0, Operand(0xFFFF)); |
| 3221 __ li(t0, Operand(36969)); | 3220 __ li(t0, Operand(36969)); |
| 3222 __ mul(a3, a3, t0); | 3221 __ Mul(a3, a3, t0); |
| 3223 __ srl(a0, a0, 16), | 3222 __ srl(a0, a0, 16), |
| 3224 __ Addu(a0, a3, a0); | 3223 __ Addu(a0, a3, a0); |
| 3225 // Save state[1]. | 3224 // Save state[1]. |
| 3226 __ sw(a0, FieldMemOperand(a2, ByteArray::kHeaderSize + kSeedSize)); | 3225 __ sw(a0, FieldMemOperand(a2, ByteArray::kHeaderSize + kSeedSize)); |
| 3227 | 3226 |
| 3228 // Random bit pattern = (state[0] << 14) + (state[1] & 0x3FFFF) | 3227 // Random bit pattern = (state[0] << 14) + (state[1] & 0x3FFFF) |
| 3229 __ And(a0, a0, Operand(0x3FFFF)); | 3228 __ And(a0, a0, Operand(0x3FFFF)); |
| 3230 __ sll(a1, a1, 14); | 3229 __ sll(a1, a1, 14); |
| 3231 __ Addu(v0, a0, a1); | 3230 __ Addu(v0, a0, a1); |
| 3232 | 3231 |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4117 instr->hydrogen()->deoptimize_on_minus_zero(), | 4116 instr->hydrogen()->deoptimize_on_minus_zero(), |
| 4118 instr->environment()); | 4117 instr->environment()); |
| 4119 } | 4118 } |
| 4120 | 4119 |
| 4121 | 4120 |
| 4122 void LCodeGen::DoDoubleToI(LDoubleToI* instr) { | 4121 void LCodeGen::DoDoubleToI(LDoubleToI* instr) { |
| 4123 Register result_reg = ToRegister(instr->result()); | 4122 Register result_reg = ToRegister(instr->result()); |
| 4124 Register scratch1 = scratch0(); | 4123 Register scratch1 = scratch0(); |
| 4125 Register scratch2 = ToRegister(instr->TempAt(0)); | 4124 Register scratch2 = ToRegister(instr->TempAt(0)); |
| 4126 DoubleRegister double_input = ToDoubleRegister(instr->InputAt(0)); | 4125 DoubleRegister double_input = ToDoubleRegister(instr->InputAt(0)); |
| 4127 DoubleRegister double_scratch = double_scratch0(); | |
| 4128 FPURegister single_scratch = double_scratch0().low(); | 4126 FPURegister single_scratch = double_scratch0().low(); |
| 4129 | 4127 |
| 4130 if (instr->truncating()) { | 4128 if (instr->truncating()) { |
| 4131 Register scratch3 = ToRegister(instr->TempAt(1)); | 4129 Register scratch3 = ToRegister(instr->TempAt(1)); |
| 4132 __ EmitECMATruncate(result_reg, | 4130 __ EmitECMATruncate(result_reg, |
| 4133 double_input, | 4131 double_input, |
| 4134 single_scratch, | 4132 single_scratch, |
| 4135 scratch1, | 4133 scratch1, |
| 4136 scratch2, | 4134 scratch2, |
| 4137 scratch3); | 4135 scratch3); |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5064 __ Subu(scratch, result, scratch); | 5062 __ Subu(scratch, result, scratch); |
| 5065 __ lw(result, FieldMemOperand(scratch, | 5063 __ lw(result, FieldMemOperand(scratch, |
| 5066 FixedArray::kHeaderSize - kPointerSize)); | 5064 FixedArray::kHeaderSize - kPointerSize)); |
| 5067 __ bind(&done); | 5065 __ bind(&done); |
| 5068 } | 5066 } |
| 5069 | 5067 |
| 5070 | 5068 |
| 5071 #undef __ | 5069 #undef __ |
| 5072 | 5070 |
| 5073 } } // namespace v8::internal | 5071 } } // namespace v8::internal |
| OLD | NEW |