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

Side by Side Diff: runtime/vm/stub_code_x64.cc

Issue 10657012: Intrinsify fixed and growable array allocation on x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « runtime/vm/stub_code_ia32.cc ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/assembler_macros.h" 9 #include "vm/assembler_macros.h"
10 #include "vm/code_generator.h" 10 #include "vm/code_generator.h"
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 // RBX : array element type (either NULL or an instantiated type). 602 // RBX : array element type (either NULL or an instantiated type).
603 // NOTE: R10 cannot be clobbered here as the caller relies on it being saved. 603 // NOTE: R10 cannot be clobbered here as the caller relies on it being saved.
604 // The newly allocated object is returned in RAX. 604 // The newly allocated object is returned in RAX.
605 void StubCode::GenerateAllocateArrayStub(Assembler* assembler) { 605 void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
606 Label slow_case; 606 Label slow_case;
607 const Immediate raw_null = 607 const Immediate raw_null =
608 Immediate(reinterpret_cast<intptr_t>(Object::null())); 608 Immediate(reinterpret_cast<intptr_t>(Object::null()));
609 609
610 if (FLAG_inline_alloc) { 610 if (FLAG_inline_alloc) {
611 // Compute the size to be allocated, it is based on the array length 611 // Compute the size to be allocated, it is based on the array length
612 // and it computed as: 612 // and is computed as:
613 // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)). 613 // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
614 // Assert that length is a Smi. 614 // Assert that length is a Smi.
615 __ testq(R10, Immediate(kSmiTagSize)); 615 __ testq(R10, Immediate(kSmiTagSize));
616 if (FLAG_use_slow_path) { 616 if (FLAG_use_slow_path) {
617 __ jmp(&slow_case); 617 __ jmp(&slow_case);
618 } else { 618 } else {
619 __ j(NOT_ZERO, &slow_case); 619 __ j(NOT_ZERO, &slow_case);
620 } 620 }
621 __ movq(R13, FieldAddress(CTX, Context::isolate_offset())); 621 __ movq(R13, FieldAddress(CTX, Context::isolate_offset()));
622 __ movq(R13, Address(R13, Isolate::heap_offset())); 622 __ movq(R13, Address(R13, Isolate::heap_offset()));
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 // TOS + 2: instance. 1869 // TOS + 2: instance.
1870 // TOS + 3: cache array. 1870 // TOS + 3: cache array.
1871 // Result in RCX: null -> not found, otherwise result (true or false). 1871 // Result in RCX: null -> not found, otherwise result (true or false).
1872 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { 1872 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) {
1873 GenerateSubtypeNTestCacheStub(assembler, 3); 1873 GenerateSubtypeNTestCacheStub(assembler, 3);
1874 } 1874 }
1875 1875
1876 } // namespace dart 1876 } // namespace dart
1877 1877
1878 #endif // defined TARGET_ARCH_X64 1878 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698