| OLD | NEW | 
|---|
| 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 704   __ bltz(T3, &slow_case); | 704   __ bltz(T3, &slow_case); | 
| 705 | 705 | 
| 706   // Check for maximum allowed length. | 706   // Check for maximum allowed length. | 
| 707   const intptr_t max_len = | 707   const intptr_t max_len = | 
| 708       reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements)); | 708       reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements)); | 
| 709   __ BranchUnsignedGreater(T3, Immediate(max_len), &slow_case); | 709   __ BranchUnsignedGreater(T3, Immediate(max_len), &slow_case); | 
| 710 | 710 | 
| 711   const intptr_t cid = kArrayCid; | 711   const intptr_t cid = kArrayCid; | 
| 712   NOT_IN_PRODUCT(__ MaybeTraceAllocation(kArrayCid, T4, &slow_case)); | 712   NOT_IN_PRODUCT(__ MaybeTraceAllocation(kArrayCid, T4, &slow_case)); | 
| 713 | 713 | 
| 714   const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1; | 714   const intptr_t fixed_size_plus_alignment_padding = | 
| 715   __ LoadImmediate(T2, fixed_size); | 715       sizeof(RawArray) + kObjectAlignment - 1; | 
|  | 716   __ LoadImmediate(T2, fixed_size_plus_alignment_padding); | 
| 716   __ sll(T3, T3, 1);  // T3 is  a Smi. | 717   __ sll(T3, T3, 1);  // T3 is  a Smi. | 
| 717   __ addu(T2, T2, T3); | 718   __ addu(T2, T2, T3); | 
| 718   ASSERT(kSmiTagShift == 1); | 719   ASSERT(kSmiTagShift == 1); | 
| 719   __ LoadImmediate(T3, ~(kObjectAlignment - 1)); | 720   __ LoadImmediate(T3, ~(kObjectAlignment - 1)); | 
| 720   __ and_(T2, T2, T3); | 721   __ and_(T2, T2, T3); | 
| 721 | 722 | 
| 722   // T2: Allocation size. | 723   // T2: Allocation size. | 
| 723 | 724 | 
| 724   Heap::Space space = Heap::kNew; | 725   Heap::Space space = Heap::kNew; | 
| 725   __ lw(T3, Address(THR, Thread::heap_offset())); | 726   __ lw(T3, Address(THR, Thread::heap_offset())); | 
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 966 // Input: | 967 // Input: | 
| 967 //   T1: number of context variables. | 968 //   T1: number of context variables. | 
| 968 // Output: | 969 // Output: | 
| 969 //   V0: new allocated RawContext object. | 970 //   V0: new allocated RawContext object. | 
| 970 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { | 971 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { | 
| 971   __ Comment("AllocateContext"); | 972   __ Comment("AllocateContext"); | 
| 972   if (FLAG_inline_alloc) { | 973   if (FLAG_inline_alloc) { | 
| 973     Label slow_case; | 974     Label slow_case; | 
| 974     // First compute the rounded instance size. | 975     // First compute the rounded instance size. | 
| 975     // T1: number of context variables. | 976     // T1: number of context variables. | 
| 976     intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1; | 977     intptr_t fixed_size_plus_alignment_padding = | 
| 977     __ LoadImmediate(T2, fixed_size); | 978         sizeof(RawContext) + kObjectAlignment - 1; | 
|  | 979     __ LoadImmediate(T2, fixed_size_plus_alignment_padding); | 
| 978     __ sll(T0, T1, 2); | 980     __ sll(T0, T1, 2); | 
| 979     __ addu(T2, T2, T0); | 981     __ addu(T2, T2, T0); | 
| 980     ASSERT(kSmiTagShift == 1); | 982     ASSERT(kSmiTagShift == 1); | 
| 981     __ LoadImmediate(T0, ~((kObjectAlignment)-1)); | 983     __ LoadImmediate(T0, ~((kObjectAlignment)-1)); | 
| 982     __ and_(T2, T2, T0); | 984     __ and_(T2, T2, T0); | 
| 983 | 985 | 
| 984     NOT_IN_PRODUCT(__ MaybeTraceAllocation(kContextCid, T4, &slow_case)); | 986     NOT_IN_PRODUCT(__ MaybeTraceAllocation(kContextCid, T4, &slow_case)); | 
| 985     // Now allocate the object. | 987     // Now allocate the object. | 
| 986     // T1: number of context variables. | 988     // T1: number of context variables. | 
| 987     // T2: object size. | 989     // T2: object size. | 
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2432 } | 2434 } | 
| 2433 | 2435 | 
| 2434 | 2436 | 
| 2435 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { | 2437 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { | 
| 2436   __ break_(0); | 2438   __ break_(0); | 
| 2437 } | 2439 } | 
| 2438 | 2440 | 
| 2439 }  // namespace dart | 2441 }  // namespace dart | 
| 2440 | 2442 | 
| 2441 #endif  // defined TARGET_ARCH_MIPS | 2443 #endif  // defined TARGET_ARCH_MIPS | 
| OLD | NEW | 
|---|