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

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

Issue 2895183002: More compact string representation on 64 bit. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 __ bltz(T3, &slow_case); 712 __ bltz(T3, &slow_case);
713 713
714 // Check for maximum allowed length. 714 // Check for maximum allowed length.
715 const intptr_t max_len = 715 const intptr_t max_len =
716 reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements)); 716 reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements));
717 __ BranchUnsignedGreater(T3, Immediate(max_len), &slow_case); 717 __ BranchUnsignedGreater(T3, Immediate(max_len), &slow_case);
718 718
719 const intptr_t cid = kArrayCid; 719 const intptr_t cid = kArrayCid;
720 NOT_IN_PRODUCT(__ MaybeTraceAllocation(kArrayCid, T4, &slow_case)); 720 NOT_IN_PRODUCT(__ MaybeTraceAllocation(kArrayCid, T4, &slow_case));
721 721
722 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1; 722 const intptr_t fixed_size_plus_alignment_padding =
723 __ LoadImmediate(T2, fixed_size); 723 sizeof(RawArray) + kObjectAlignment - 1;
724 __ LoadImmediate(T2, fixed_size_plus_alignment_padding);
724 __ sll(T3, T3, 1); // T3 is a Smi. 725 __ sll(T3, T3, 1); // T3 is a Smi.
725 __ addu(T2, T2, T3); 726 __ addu(T2, T2, T3);
726 ASSERT(kSmiTagShift == 1); 727 ASSERT(kSmiTagShift == 1);
727 __ LoadImmediate(T3, ~(kObjectAlignment - 1)); 728 __ LoadImmediate(T3, ~(kObjectAlignment - 1));
728 __ and_(T2, T2, T3); 729 __ and_(T2, T2, T3);
729 730
730 // T2: Allocation size. 731 // T2: Allocation size.
731 732
732 Heap::Space space = Heap::kNew; 733 Heap::Space space = Heap::kNew;
733 __ lw(T3, Address(THR, Thread::heap_offset())); 734 __ lw(T3, Address(THR, Thread::heap_offset()));
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 // Input: 975 // Input:
975 // T1: number of context variables. 976 // T1: number of context variables.
976 // Output: 977 // Output:
977 // V0: new allocated RawContext object. 978 // V0: new allocated RawContext object.
978 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { 979 void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
979 __ Comment("AllocateContext"); 980 __ Comment("AllocateContext");
980 if (FLAG_inline_alloc) { 981 if (FLAG_inline_alloc) {
981 Label slow_case; 982 Label slow_case;
982 // First compute the rounded instance size. 983 // First compute the rounded instance size.
983 // T1: number of context variables. 984 // T1: number of context variables.
984 intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1; 985 intptr_t fixed_size_plus_alignment_padding =
985 __ LoadImmediate(T2, fixed_size); 986 sizeof(RawContext) + kObjectAlignment - 1;
987 __ LoadImmediate(T2, fixed_size_plus_alignment_padding);
986 __ sll(T0, T1, 2); 988 __ sll(T0, T1, 2);
987 __ addu(T2, T2, T0); 989 __ addu(T2, T2, T0);
988 ASSERT(kSmiTagShift == 1); 990 ASSERT(kSmiTagShift == 1);
989 __ LoadImmediate(T0, ~((kObjectAlignment)-1)); 991 __ LoadImmediate(T0, ~((kObjectAlignment)-1));
990 __ and_(T2, T2, T0); 992 __ and_(T2, T2, T0);
991 993
992 NOT_IN_PRODUCT(__ MaybeTraceAllocation(kContextCid, T4, &slow_case)); 994 NOT_IN_PRODUCT(__ MaybeTraceAllocation(kContextCid, T4, &slow_case));
993 // Now allocate the object. 995 // Now allocate the object.
994 // T1: number of context variables. 996 // T1: number of context variables.
995 // T2: object size. 997 // T2: object size.
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2447 } 2449 }
2448 2450
2449 2451
2450 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { 2452 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
2451 __ break_(0); 2453 __ break_(0);
2452 } 2454 }
2453 2455
2454 } // namespace dart 2456 } // namespace dart
2455 2457
2456 #endif // defined TARGET_ARCH_MIPS 2458 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698