Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 9174023: Split NumberDictionary into a randomly seeded and an unseeded (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/v8globals.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3470 matching lines...) Expand 10 before | Expand all | Expand 10 after
3481 // result - holds the result on exit if the load succeeded. 3481 // result - holds the result on exit if the load succeeded.
3482 // Allowed to be the same as 'key' or 'result'. 3482 // Allowed to be the same as 'key' or 'result'.
3483 // Unchanged on bailout so 'key' or 'result' can be used 3483 // Unchanged on bailout so 'key' or 'result' can be used
3484 // in further computation. 3484 // in further computation.
3485 3485
3486 Label done; 3486 Label done;
3487 3487
3488 GetNumberHash(r0, r1); 3488 GetNumberHash(r0, r1);
3489 3489
3490 // Compute capacity mask. 3490 // Compute capacity mask.
3491 SmiToInteger32(r1, 3491 SmiToInteger32(r1, FieldOperand(elements,
3492 FieldOperand(elements, NumberDictionary::kCapacityOffset)); 3492 SeededNumberDictionary::kCapacityOffset));
3493 decl(r1); 3493 decl(r1);
3494 3494
3495 // Generate an unrolled loop that performs a few probes before giving up. 3495 // Generate an unrolled loop that performs a few probes before giving up.
3496 const int kProbes = 4; 3496 const int kProbes = 4;
3497 for (int i = 0; i < kProbes; i++) { 3497 for (int i = 0; i < kProbes; i++) {
3498 // Use r2 for index calculations and keep the hash intact in r0. 3498 // Use r2 for index calculations and keep the hash intact in r0.
3499 movq(r2, r0); 3499 movq(r2, r0);
3500 // Compute the masked index: (hash + i + i * i) & mask. 3500 // Compute the masked index: (hash + i + i * i) & mask.
3501 if (i > 0) { 3501 if (i > 0) {
3502 addl(r2, Immediate(NumberDictionary::GetProbeOffset(i))); 3502 addl(r2, Immediate(SeededNumberDictionary::GetProbeOffset(i)));
3503 } 3503 }
3504 and_(r2, r1); 3504 and_(r2, r1);
3505 3505
3506 // Scale the index by multiplying by the entry size. 3506 // Scale the index by multiplying by the entry size.
3507 ASSERT(NumberDictionary::kEntrySize == 3); 3507 ASSERT(SeededNumberDictionary::kEntrySize == 3);
3508 lea(r2, Operand(r2, r2, times_2, 0)); // r2 = r2 * 3 3508 lea(r2, Operand(r2, r2, times_2, 0)); // r2 = r2 * 3
3509 3509
3510 // Check if the key matches. 3510 // Check if the key matches.
3511 cmpq(key, FieldOperand(elements, 3511 cmpq(key, FieldOperand(elements,
3512 r2, 3512 r2,
3513 times_pointer_size, 3513 times_pointer_size,
3514 NumberDictionary::kElementsStartOffset)); 3514 SeededNumberDictionary::kElementsStartOffset));
3515 if (i != (kProbes - 1)) { 3515 if (i != (kProbes - 1)) {
3516 j(equal, &done); 3516 j(equal, &done);
3517 } else { 3517 } else {
3518 j(not_equal, miss); 3518 j(not_equal, miss);
3519 } 3519 }
3520 } 3520 }
3521 3521
3522 bind(&done); 3522 bind(&done);
3523 // Check that the value is a normal propety. 3523 // Check that the value is a normal propety.
3524 const int kDetailsOffset = 3524 const int kDetailsOffset =
3525 NumberDictionary::kElementsStartOffset + 2 * kPointerSize; 3525 SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
3526 ASSERT_EQ(NORMAL, 0); 3526 ASSERT_EQ(NORMAL, 0);
3527 Test(FieldOperand(elements, r2, times_pointer_size, kDetailsOffset), 3527 Test(FieldOperand(elements, r2, times_pointer_size, kDetailsOffset),
3528 Smi::FromInt(PropertyDetails::TypeField::kMask)); 3528 Smi::FromInt(PropertyDetails::TypeField::kMask));
3529 j(not_zero, miss); 3529 j(not_zero, miss);
3530 3530
3531 // Get the value at the masked, scaled index. 3531 // Get the value at the masked, scaled index.
3532 const int kValueOffset = 3532 const int kValueOffset =
3533 NumberDictionary::kElementsStartOffset + kPointerSize; 3533 SeededNumberDictionary::kElementsStartOffset + kPointerSize;
3534 movq(result, FieldOperand(elements, r2, times_pointer_size, kValueOffset)); 3534 movq(result, FieldOperand(elements, r2, times_pointer_size, kValueOffset));
3535 } 3535 }
3536 3536
3537 3537
3538 void MacroAssembler::LoadAllocationTopHelper(Register result, 3538 void MacroAssembler::LoadAllocationTopHelper(Register result,
3539 Register scratch, 3539 Register scratch,
3540 AllocationFlags flags) { 3540 AllocationFlags flags) {
3541 ExternalReference new_space_allocation_top = 3541 ExternalReference new_space_allocation_top =
3542 ExternalReference::new_space_allocation_top_address(isolate()); 3542 ExternalReference::new_space_allocation_top_address(isolate());
3543 3543
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
4325 4325
4326 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); 4326 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask));
4327 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); 4327 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length);
4328 4328
4329 bind(&done); 4329 bind(&done);
4330 } 4330 }
4331 4331
4332 } } // namespace v8::internal 4332 } } // namespace v8::internal
4333 4333
4334 #endif // V8_TARGET_ARCH_X64 4334 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/v8globals.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698