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

Side by Side Diff: src/arm/code-stubs-arm.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 | « no previous file | src/arm/codegen-arm.cc » ('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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 int elements_size = 0; 354 int elements_size = 0;
355 if (length > 0) { 355 if (length > 0) {
356 elements_size = mode == FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS 356 elements_size = mode == FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS
357 ? FixedDoubleArray::SizeFor(length) 357 ? FixedDoubleArray::SizeFor(length)
358 : FixedArray::SizeFor(length); 358 : FixedArray::SizeFor(length);
359 } 359 }
360 int size = JSArray::kSize + elements_size; 360 int size = JSArray::kSize + elements_size;
361 361
362 // Allocate both the JS array and the elements array in one big 362 // Allocate both the JS array and the elements array in one big
363 // allocation. This avoids multiple limit checks. 363 // allocation. This avoids multiple limit checks.
364 __ AllocateInNewSpace(size, 364 AllocationFlags flags = TAG_OBJECT;
365 r0, 365 if (mode == FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS) {
366 r1, 366 flags = static_cast<AllocationFlags>(DOUBLE_ALIGNMENT | flags);
367 r2, 367 }
368 fail, 368 __ AllocateInNewSpace(size, r0, r1, r2, fail, flags);
369 TAG_OBJECT);
370 369
371 // Copy the JS array part. 370 // Copy the JS array part.
372 for (int i = 0; i < JSArray::kSize; i += kPointerSize) { 371 for (int i = 0; i < JSArray::kSize; i += kPointerSize) {
373 if ((i != JSArray::kElementsOffset) || (length == 0)) { 372 if ((i != JSArray::kElementsOffset) || (length == 0)) {
374 __ ldr(r1, FieldMemOperand(r3, i)); 373 __ ldr(r1, FieldMemOperand(r3, i));
375 __ str(r1, FieldMemOperand(r0, i)); 374 __ str(r1, FieldMemOperand(r0, i));
376 } 375 }
377 } 376 }
378 377
379 if (length > 0) { 378 if (length > 0) {
(...skipping 7331 matching lines...) Expand 10 before | Expand all | Expand 10 after
7711 7710
7712 __ Pop(lr, r5, r1); 7711 __ Pop(lr, r5, r1);
7713 __ Ret(); 7712 __ Ret();
7714 } 7713 }
7715 7714
7716 #undef __ 7715 #undef __
7717 7716
7718 } } // namespace v8::internal 7717 } } // namespace v8::internal
7719 7718
7720 #endif // V8_TARGET_ARCH_ARM 7719 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698