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 3207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3218 __ lw(a1, FieldMemOperand(a2, ByteArray::kHeaderSize)); | 3218 __ lw(a1, FieldMemOperand(a2, ByteArray::kHeaderSize)); |
3219 __ Branch(deferred->entry(), eq, a1, Operand(zero_reg)); | 3219 __ Branch(deferred->entry(), eq, a1, Operand(zero_reg)); |
3220 // Load state[1]. | 3220 // Load state[1]. |
3221 __ lw(a0, FieldMemOperand(a2, ByteArray::kHeaderSize + kSeedSize)); | 3221 __ lw(a0, FieldMemOperand(a2, ByteArray::kHeaderSize + kSeedSize)); |
3222 // a1: state[0]. | 3222 // a1: state[0]. |
3223 // a0: state[1]. | 3223 // a0: state[1]. |
3224 | 3224 |
3225 // state[0] = 18273 * (state[0] & 0xFFFF) + (state[0] >> 16) | 3225 // state[0] = 18273 * (state[0] & 0xFFFF) + (state[0] >> 16) |
3226 __ And(a3, a1, Operand(0xFFFF)); | 3226 __ And(a3, a1, Operand(0xFFFF)); |
3227 __ li(t0, Operand(18273)); | 3227 __ li(t0, Operand(18273)); |
3228 __ mul(a3, a3, t0); | 3228 __ Mul(a3, a3, t0); |
3229 __ srl(a1, a1, 16); | 3229 __ srl(a1, a1, 16); |
3230 __ Addu(a1, a3, a1); | 3230 __ Addu(a1, a3, a1); |
3231 // Save state[0]. | 3231 // Save state[0]. |
3232 __ sw(a1, FieldMemOperand(a2, ByteArray::kHeaderSize)); | 3232 __ sw(a1, FieldMemOperand(a2, ByteArray::kHeaderSize)); |
3233 | 3233 |
3234 // state[1] = 36969 * (state[1] & 0xFFFF) + (state[1] >> 16) | 3234 // state[1] = 36969 * (state[1] & 0xFFFF) + (state[1] >> 16) |
3235 __ And(a3, a0, Operand(0xFFFF)); | 3235 __ And(a3, a0, Operand(0xFFFF)); |
3236 __ li(t0, Operand(36969)); | 3236 __ li(t0, Operand(36969)); |
3237 __ mul(a3, a3, t0); | 3237 __ Mul(a3, a3, t0); |
3238 __ srl(a0, a0, 16), | 3238 __ srl(a0, a0, 16), |
3239 __ Addu(a0, a3, a0); | 3239 __ Addu(a0, a3, a0); |
3240 // Save state[1]. | 3240 // Save state[1]. |
3241 __ sw(a0, FieldMemOperand(a2, ByteArray::kHeaderSize + kSeedSize)); | 3241 __ sw(a0, FieldMemOperand(a2, ByteArray::kHeaderSize + kSeedSize)); |
3242 | 3242 |
3243 // Random bit pattern = (state[0] << 14) + (state[1] & 0x3FFFF) | 3243 // Random bit pattern = (state[0] << 14) + (state[1] & 0x3FFFF) |
3244 __ And(a0, a0, Operand(0x3FFFF)); | 3244 __ And(a0, a0, Operand(0x3FFFF)); |
3245 __ sll(a1, a1, 14); | 3245 __ sll(a1, a1, 14); |
3246 __ Addu(v0, a0, a1); | 3246 __ Addu(v0, a0, a1); |
3247 | 3247 |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5125 __ Subu(scratch, result, scratch); | 5125 __ Subu(scratch, result, scratch); |
5126 __ lw(result, FieldMemOperand(scratch, | 5126 __ lw(result, FieldMemOperand(scratch, |
5127 FixedArray::kHeaderSize - kPointerSize)); | 5127 FixedArray::kHeaderSize - kPointerSize)); |
5128 __ bind(&done); | 5128 __ bind(&done); |
5129 } | 5129 } |
5130 | 5130 |
5131 | 5131 |
5132 #undef __ | 5132 #undef __ |
5133 | 5133 |
5134 } } // namespace v8::internal | 5134 } } // namespace v8::internal |
OLD | NEW |