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 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3413 DeferredDoRandom* deferred = new(zone()) DeferredDoRandom(this, instr); | 3413 DeferredDoRandom* deferred = new(zone()) DeferredDoRandom(this, instr); |
3414 | 3414 |
3415 // Having marked this instruction as a call we can use any | 3415 // Having marked this instruction as a call we can use any |
3416 // registers. | 3416 // registers. |
3417 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); | 3417 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); |
3418 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); | 3418 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); |
3419 // Assert that the register size is indeed the size of each seed. | 3419 // Assert that the register size is indeed the size of each seed. |
3420 static const int kSeedSize = sizeof(uint32_t); | 3420 static const int kSeedSize = sizeof(uint32_t); |
3421 STATIC_ASSERT(kPointerSize == kSeedSize); | 3421 STATIC_ASSERT(kPointerSize == kSeedSize); |
3422 | 3422 |
3423 __ mov(eax, FieldOperand(eax, GlobalObject::kGlobalContextOffset)); | 3423 __ mov(eax, FieldOperand(eax, GlobalObject::kNativeContextOffset)); |
3424 static const int kRandomSeedOffset = | 3424 static const int kRandomSeedOffset = |
3425 FixedArray::kHeaderSize + Context::RANDOM_SEED_INDEX * kPointerSize; | 3425 FixedArray::kHeaderSize + Context::RANDOM_SEED_INDEX * kPointerSize; |
3426 __ mov(ebx, FieldOperand(eax, kRandomSeedOffset)); | 3426 __ mov(ebx, FieldOperand(eax, kRandomSeedOffset)); |
3427 // ebx: FixedArray of the global context's random seeds | 3427 // ebx: FixedArray of the native context's random seeds |
3428 | 3428 |
3429 // Load state[0]. | 3429 // Load state[0]. |
3430 __ mov(ecx, FieldOperand(ebx, ByteArray::kHeaderSize)); | 3430 __ mov(ecx, FieldOperand(ebx, ByteArray::kHeaderSize)); |
3431 // If state[0] == 0, call runtime to initialize seeds. | 3431 // If state[0] == 0, call runtime to initialize seeds. |
3432 __ test(ecx, ecx); | 3432 __ test(ecx, ecx); |
3433 __ j(zero, deferred->entry()); | 3433 __ j(zero, deferred->entry()); |
3434 // Load state[1]. | 3434 // Load state[1]. |
3435 __ mov(eax, FieldOperand(ebx, ByteArray::kHeaderSize + kSeedSize)); | 3435 __ mov(eax, FieldOperand(ebx, ByteArray::kHeaderSize + kSeedSize)); |
3436 // ecx: state[0] | 3436 // ecx: state[0] |
3437 // eax: state[1] | 3437 // eax: state[1] |
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5422 FixedArray::kHeaderSize - kPointerSize)); | 5422 FixedArray::kHeaderSize - kPointerSize)); |
5423 __ bind(&done); | 5423 __ bind(&done); |
5424 } | 5424 } |
5425 | 5425 |
5426 | 5426 |
5427 #undef __ | 5427 #undef __ |
5428 | 5428 |
5429 } } // namespace v8::internal | 5429 } } // namespace v8::internal |
5430 | 5430 |
5431 #endif // V8_TARGET_ARCH_IA32 | 5431 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |