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

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 11684005: Refactor and improve inlined double-aligned allocations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 12 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/ia32/code-stubs-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 __ j(equal, &only_change_map); 427 __ j(equal, &only_change_map);
428 428
429 __ push(eax); 429 __ push(eax);
430 __ push(ebx); 430 __ push(ebx);
431 431
432 __ mov(edi, FieldOperand(edi, FixedArray::kLengthOffset)); 432 __ mov(edi, FieldOperand(edi, FixedArray::kLengthOffset));
433 433
434 // Allocate new FixedDoubleArray. 434 // Allocate new FixedDoubleArray.
435 // edx: receiver 435 // edx: receiver
436 // edi: length of source FixedArray (smi-tagged) 436 // edi: length of source FixedArray (smi-tagged)
437 __ lea(esi, Operand(edi, 437 AllocationFlags flags =
438 times_4, 438 static_cast<AllocationFlags>(TAG_OBJECT | DOUBLE_ALIGNMENT);
439 FixedDoubleArray::kHeaderSize + kPointerSize)); 439 __ AllocateInNewSpace(FixedDoubleArray::kHeaderSize, times_8,
440 __ AllocateInNewSpace(esi, eax, ebx, no_reg, &gc_required, TAG_OBJECT); 440 edi, REGISTER_VALUE_IS_SMI,
441 441 eax, ebx, no_reg, &gc_required, flags);
442 Label aligned, aligned_done;
443 __ test(eax, Immediate(kDoubleAlignmentMask - kHeapObjectTag));
444 __ j(zero, &aligned, Label::kNear);
445 __ mov(FieldOperand(eax, 0),
446 Immediate(masm->isolate()->factory()->one_pointer_filler_map()));
447 __ add(eax, Immediate(kPointerSize));
448 __ jmp(&aligned_done);
449
450 __ bind(&aligned);
451 __ mov(Operand(eax, esi, times_1, -kPointerSize-1),
452 Immediate(masm->isolate()->factory()->one_pointer_filler_map()));
453
454 __ bind(&aligned_done);
455 442
456 // eax: destination FixedDoubleArray 443 // eax: destination FixedDoubleArray
457 // edi: number of elements 444 // edi: number of elements
458 // edx: receiver 445 // edx: receiver
459 __ mov(FieldOperand(eax, HeapObject::kMapOffset), 446 __ mov(FieldOperand(eax, HeapObject::kMapOffset),
460 Immediate(masm->isolate()->factory()->fixed_double_array_map())); 447 Immediate(masm->isolate()->factory()->fixed_double_array_map()));
461 __ mov(FieldOperand(eax, FixedDoubleArray::kLengthOffset), edi); 448 __ mov(FieldOperand(eax, FixedDoubleArray::kLengthOffset), edi);
462 __ mov(esi, FieldOperand(edx, JSObject::kElementsOffset)); 449 __ mov(esi, FieldOperand(edx, JSObject::kElementsOffset));
463 // Replace receiver's backing store with newly created FixedDoubleArray. 450 // Replace receiver's backing store with newly created FixedDoubleArray.
464 __ mov(FieldOperand(edx, JSObject::kElementsOffset), eax); 451 __ mov(FieldOperand(edx, JSObject::kElementsOffset), eax);
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 Code* stub = GetCodeAgeStub(age, parity); 939 Code* stub = GetCodeAgeStub(age, parity);
953 CodePatcher patcher(sequence, young_length); 940 CodePatcher patcher(sequence, young_length);
954 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE); 941 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE);
955 } 942 }
956 } 943 }
957 944
958 945
959 } } // namespace v8::internal 946 } } // namespace v8::internal
960 947
961 #endif // V8_TARGET_ARCH_IA32 948 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698