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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 if (emit_debug_code()) { | 642 if (emit_debug_code()) { |
643 cmp(Operand(ebp, StandardFrameConstants::kMarkerOffset), | 643 cmp(Operand(ebp, StandardFrameConstants::kMarkerOffset), |
644 Immediate(Smi::FromInt(type))); | 644 Immediate(Smi::FromInt(type))); |
645 Check(equal, "stack frame types must match"); | 645 Check(equal, "stack frame types must match"); |
646 } | 646 } |
647 leave(); | 647 leave(); |
648 } | 648 } |
649 | 649 |
650 | 650 |
651 void MacroAssembler::EnterExitFramePrologue() { | 651 void MacroAssembler::EnterExitFramePrologue() { |
652 // Setup the frame structure on the stack. | 652 // Set up the frame structure on the stack. |
653 ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize); | 653 ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize); |
654 ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize); | 654 ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize); |
655 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize); | 655 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize); |
656 push(ebp); | 656 push(ebp); |
657 mov(ebp, esp); | 657 mov(ebp, esp); |
658 | 658 |
659 // Reserve room for entry stack pointer and push the code object. | 659 // Reserve room for entry stack pointer and push the code object. |
660 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); | 660 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); |
661 push(Immediate(0)); // Saved entry sp, patched before call. | 661 push(Immediate(0)); // Saved entry sp, patched before call. |
662 push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot. | 662 push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 } | 694 } |
695 | 695 |
696 // Patch the saved entry sp. | 696 // Patch the saved entry sp. |
697 mov(Operand(ebp, ExitFrameConstants::kSPOffset), esp); | 697 mov(Operand(ebp, ExitFrameConstants::kSPOffset), esp); |
698 } | 698 } |
699 | 699 |
700 | 700 |
701 void MacroAssembler::EnterExitFrame(bool save_doubles) { | 701 void MacroAssembler::EnterExitFrame(bool save_doubles) { |
702 EnterExitFramePrologue(); | 702 EnterExitFramePrologue(); |
703 | 703 |
704 // Setup argc and argv in callee-saved registers. | 704 // Set up argc and argv in callee-saved registers. |
705 int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize; | 705 int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize; |
706 mov(edi, eax); | 706 mov(edi, eax); |
707 lea(esi, Operand(ebp, eax, times_4, offset)); | 707 lea(esi, Operand(ebp, eax, times_4, offset)); |
708 | 708 |
709 // Reserve space for argc, argv and isolate. | 709 // Reserve space for argc, argv and isolate. |
710 EnterExitFrameEpilogue(3, save_doubles); | 710 EnterExitFrameEpilogue(3, save_doubles); |
711 } | 711 } |
712 | 712 |
713 | 713 |
714 void MacroAssembler::EnterApiExitFrame(int argc) { | 714 void MacroAssembler::EnterApiExitFrame(int argc) { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 // Compute the hash code from the untagged key. This must be kept in sync | 995 // Compute the hash code from the untagged key. This must be kept in sync |
996 // with ComputeIntegerHash in utils.h. | 996 // with ComputeIntegerHash in utils.h. |
997 // | 997 // |
998 // Note: r0 will contain hash code | 998 // Note: r0 will contain hash code |
999 void MacroAssembler::GetNumberHash(Register r0, Register scratch) { | 999 void MacroAssembler::GetNumberHash(Register r0, Register scratch) { |
1000 // Xor original key with a seed. | 1000 // Xor original key with a seed. |
1001 if (Serializer::enabled()) { | 1001 if (Serializer::enabled()) { |
1002 ExternalReference roots_array_start = | 1002 ExternalReference roots_array_start = |
1003 ExternalReference::roots_array_start(isolate()); | 1003 ExternalReference::roots_array_start(isolate()); |
1004 mov(scratch, Immediate(Heap::kHashSeedRootIndex)); | 1004 mov(scratch, Immediate(Heap::kHashSeedRootIndex)); |
1005 xor_(r0, Operand::StaticArray(scratch, | 1005 mov(scratch, |
1006 times_pointer_size, | 1006 Operand::StaticArray(scratch, times_pointer_size, roots_array_start)); |
1007 roots_array_start)); | 1007 SmiUntag(scratch); |
| 1008 xor_(r0, scratch); |
1008 } else { | 1009 } else { |
1009 int32_t seed = isolate()->heap()->HashSeed(); | 1010 int32_t seed = isolate()->heap()->HashSeed(); |
1010 xor_(r0, Immediate(seed)); | 1011 xor_(r0, Immediate(seed)); |
1011 } | 1012 } |
1012 | 1013 |
1013 // hash = ~hash + (hash << 15); | 1014 // hash = ~hash + (hash << 15); |
1014 mov(scratch, r0); | 1015 mov(scratch, r0); |
1015 not_(r0); | 1016 not_(r0); |
1016 shl(scratch, 15); | 1017 shl(scratch, 15); |
1017 add(r0, scratch); | 1018 add(r0, scratch); |
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2738 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2739 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
2739 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2740 Check(less_equal, "Live Bytes Count overflow chunk size"); |
2740 } | 2741 } |
2741 | 2742 |
2742 bind(&done); | 2743 bind(&done); |
2743 } | 2744 } |
2744 | 2745 |
2745 } } // namespace v8::internal | 2746 } } // namespace v8::internal |
2746 | 2747 |
2747 #endif // V8_TARGET_ARCH_IA32 | 2748 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |