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

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

Issue 11659022: Generate the TransitionElementsStub using Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tweaks Created 7 years, 10 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
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 3859 matching lines...) Expand 10 before | Expand all | Expand 10 after
3870 } 3870 }
3871 } 3871 }
3872 3872
3873 3873
3874 void MacroAssembler::AllocateInNewSpace(Register object_size, 3874 void MacroAssembler::AllocateInNewSpace(Register object_size,
3875 Register result, 3875 Register result,
3876 Register result_end, 3876 Register result_end,
3877 Register scratch, 3877 Register scratch,
3878 Label* gc_required, 3878 Label* gc_required,
3879 AllocationFlags flags) { 3879 AllocationFlags flags) {
3880 ASSERT((flags & (DOUBLE_ALIGNMENT | RESULT_CONTAINS_TOP | 3880 ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0);
3881 SIZE_IN_WORDS)) == 0);
3882 if (!FLAG_inline_new) { 3881 if (!FLAG_inline_new) {
3883 if (emit_debug_code()) { 3882 if (emit_debug_code()) {
3884 // Trash the registers to simulate an allocation failure. 3883 // Trash the registers to simulate an allocation failure.
3885 movl(result, Immediate(0x7091)); 3884 movl(result, Immediate(0x7091));
3886 movl(result_end, Immediate(0x7191)); 3885 movl(result_end, Immediate(0x7191));
3887 if (scratch.is_valid()) { 3886 if (scratch.is_valid()) {
3888 movl(scratch, Immediate(0x7291)); 3887 movl(scratch, Immediate(0x7291));
3889 } 3888 }
3890 // object_size is left unchanged by this function. 3889 // object_size is left unchanged by this function.
3891 } 3890 }
(...skipping 13 matching lines...) Expand all
3905 } 3904 }
3906 addq(result_end, result); 3905 addq(result_end, result);
3907 j(carry, gc_required); 3906 j(carry, gc_required);
3908 Operand limit_operand = ExternalOperand(new_space_allocation_limit); 3907 Operand limit_operand = ExternalOperand(new_space_allocation_limit);
3909 cmpq(result_end, limit_operand); 3908 cmpq(result_end, limit_operand);
3910 j(above, gc_required); 3909 j(above, gc_required);
3911 3910
3912 // Update allocation top. 3911 // Update allocation top.
3913 UpdateAllocationTopHelper(result_end, scratch); 3912 UpdateAllocationTopHelper(result_end, scratch);
3914 3913
3914 // Align the next allocation. Storing the filler map without checking top is
3915 // always safe because the limit of the heap is always aligned.
3916 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
3917 testq(result, Immediate(kDoubleAlignmentMask));
3918 Check(zero, "Allocation is not double aligned");
3919 }
3920
3915 // Tag the result if requested. 3921 // Tag the result if requested.
3916 if ((flags & TAG_OBJECT) != 0) { 3922 if ((flags & TAG_OBJECT) != 0) {
3917 addq(result, Immediate(kHeapObjectTag)); 3923 addq(result, Immediate(kHeapObjectTag));
3918 } 3924 }
3919 } 3925 }
3920 3926
3921 3927
3922 void MacroAssembler::UndoAllocationInNewSpace(Register object) { 3928 void MacroAssembler::UndoAllocationInNewSpace(Register object) {
3923 ExternalReference new_space_allocation_top = 3929 ExternalReference new_space_allocation_top =
3924 ExternalReference::new_space_allocation_top_address(isolate()); 3930 ExternalReference::new_space_allocation_top_address(isolate());
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
4599 FieldOperand(rcx, JSObject::kElementsOffset)); 4605 FieldOperand(rcx, JSObject::kElementsOffset));
4600 j(not_equal, call_runtime); 4606 j(not_equal, call_runtime);
4601 4607
4602 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); 4608 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset));
4603 cmpq(rcx, null_value); 4609 cmpq(rcx, null_value);
4604 j(not_equal, &next); 4610 j(not_equal, &next);
4605 } 4611 }
4606 4612
4607 void MacroAssembler::TestJSArrayForAllocationSiteInfo( 4613 void MacroAssembler::TestJSArrayForAllocationSiteInfo(
4608 Register receiver_reg, 4614 Register receiver_reg,
4609 Register scratch_reg, 4615 Register scratch_reg) {
4610 Label* allocation_info_present) {
4611 Label no_info_available; 4616 Label no_info_available;
4612 ExternalReference new_space_start = 4617 ExternalReference new_space_start =
4613 ExternalReference::new_space_start(isolate()); 4618 ExternalReference::new_space_start(isolate());
4614 ExternalReference new_space_allocation_top = 4619 ExternalReference new_space_allocation_top =
4615 ExternalReference::new_space_allocation_top_address(isolate()); 4620 ExternalReference::new_space_allocation_top_address(isolate());
4616 4621
4617 lea(scratch_reg, Operand(receiver_reg, 4622 lea(scratch_reg, Operand(receiver_reg,
4618 JSArray::kSize + AllocationSiteInfo::kSize - kHeapObjectTag)); 4623 JSArray::kSize + AllocationSiteInfo::kSize - kHeapObjectTag));
4619 movq(kScratchRegister, new_space_start); 4624 movq(kScratchRegister, new_space_start);
4620 cmpq(scratch_reg, kScratchRegister); 4625 cmpq(scratch_reg, kScratchRegister);
4621 j(less, &no_info_available); 4626 j(less, &no_info_available);
4622 cmpq(scratch_reg, ExternalOperand(new_space_allocation_top)); 4627 cmpq(scratch_reg, ExternalOperand(new_space_allocation_top));
4623 j(greater, &no_info_available); 4628 j(greater, &no_info_available);
4624 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), 4629 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize),
4625 Heap::kAllocationSiteInfoMapRootIndex); 4630 Heap::kAllocationSiteInfoMapRootIndex);
4626 j(equal, allocation_info_present);
4627 bind(&no_info_available); 4631 bind(&no_info_available);
4628 } 4632 }
4629 4633
4630 4634
4631 } } // namespace v8::internal 4635 } } // namespace v8::internal
4632 4636
4633 #endif // V8_TARGET_ARCH_X64 4637 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698