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 3578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3589 DeferredDoRandom* deferred = new(zone()) DeferredDoRandom(this, instr); | 3589 DeferredDoRandom* deferred = new(zone()) DeferredDoRandom(this, instr); |
3590 | 3590 |
3591 // Having marked this instruction as a call we can use any | 3591 // Having marked this instruction as a call we can use any |
3592 // registers. | 3592 // registers. |
3593 ASSERT(ToDoubleRegister(instr->result()).is(d7)); | 3593 ASSERT(ToDoubleRegister(instr->result()).is(d7)); |
3594 ASSERT(ToRegister(instr->InputAt(0)).is(r0)); | 3594 ASSERT(ToRegister(instr->InputAt(0)).is(r0)); |
3595 | 3595 |
3596 static const int kSeedSize = sizeof(uint32_t); | 3596 static const int kSeedSize = sizeof(uint32_t); |
3597 STATIC_ASSERT(kPointerSize == kSeedSize); | 3597 STATIC_ASSERT(kPointerSize == kSeedSize); |
3598 | 3598 |
3599 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalContextOffset)); | 3599 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); |
3600 static const int kRandomSeedOffset = | 3600 static const int kRandomSeedOffset = |
3601 FixedArray::kHeaderSize + Context::RANDOM_SEED_INDEX * kPointerSize; | 3601 FixedArray::kHeaderSize + Context::RANDOM_SEED_INDEX * kPointerSize; |
3602 __ ldr(r2, FieldMemOperand(r0, kRandomSeedOffset)); | 3602 __ ldr(r2, FieldMemOperand(r0, kRandomSeedOffset)); |
3603 // r2: FixedArray of the global context's random seeds | 3603 // r2: FixedArray of the native context's random seeds |
3604 | 3604 |
3605 // Load state[0]. | 3605 // Load state[0]. |
3606 __ ldr(r1, FieldMemOperand(r2, ByteArray::kHeaderSize)); | 3606 __ ldr(r1, FieldMemOperand(r2, ByteArray::kHeaderSize)); |
3607 __ cmp(r1, Operand(0)); | 3607 __ cmp(r1, Operand(0)); |
3608 __ b(eq, deferred->entry()); | 3608 __ b(eq, deferred->entry()); |
3609 // Load state[1]. | 3609 // Load state[1]. |
3610 __ ldr(r0, FieldMemOperand(r2, ByteArray::kHeaderSize + kSeedSize)); | 3610 __ ldr(r0, FieldMemOperand(r2, ByteArray::kHeaderSize + kSeedSize)); |
3611 // r1: state[0]. | 3611 // r1: state[0]. |
3612 // r0: state[1]. | 3612 // r0: state[1]. |
3613 | 3613 |
(...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5527 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5527 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5528 __ ldr(result, FieldMemOperand(scratch, | 5528 __ ldr(result, FieldMemOperand(scratch, |
5529 FixedArray::kHeaderSize - kPointerSize)); | 5529 FixedArray::kHeaderSize - kPointerSize)); |
5530 __ bind(&done); | 5530 __ bind(&done); |
5531 } | 5531 } |
5532 | 5532 |
5533 | 5533 |
5534 #undef __ | 5534 #undef __ |
5535 | 5535 |
5536 } } // namespace v8::internal | 5536 } } // namespace v8::internal |
OLD | NEW |