| 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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 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/longjump.h" | 9 #include "vm/longjump.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 Register instance_reg, | 976 Register instance_reg, |
| 977 Register temp_reg) { | 977 Register temp_reg) { |
| 978 ASSERT(!in_delay_slot_); | 978 ASSERT(!in_delay_slot_); |
| 979 ASSERT(failure != NULL); | 979 ASSERT(failure != NULL); |
| 980 if (FLAG_inline_alloc) { | 980 if (FLAG_inline_alloc) { |
| 981 // If this allocation is traced, program will jump to failure path | 981 // If this allocation is traced, program will jump to failure path |
| 982 // (i.e. the allocation stub) which will allocate the object and trace the | 982 // (i.e. the allocation stub) which will allocate the object and trace the |
| 983 // allocation call site. | 983 // allocation call site. |
| 984 MaybeTraceAllocation(cls.id(), temp_reg, failure); | 984 MaybeTraceAllocation(cls.id(), temp_reg, failure); |
| 985 const intptr_t instance_size = cls.instance_size(); | 985 const intptr_t instance_size = cls.instance_size(); |
| 986 Heap::Space space = Heap::SpaceForAllocation(cls.id()); | 986 Heap::Space space = Heap::kNew; |
| 987 lw(temp_reg, Address(THR, Thread::heap_offset())); | 987 lw(temp_reg, Address(THR, Thread::heap_offset())); |
| 988 lw(instance_reg, Address(temp_reg, Heap::TopOffset(space))); | 988 lw(instance_reg, Address(temp_reg, Heap::TopOffset(space))); |
| 989 // TODO(koda): Protect against unsigned overflow here. | 989 // TODO(koda): Protect against unsigned overflow here. |
| 990 AddImmediate(instance_reg, instance_size); | 990 AddImmediate(instance_reg, instance_size); |
| 991 | 991 |
| 992 // instance_reg: potential next object start. | 992 // instance_reg: potential next object start. |
| 993 lw(TMP, Address(temp_reg, Heap::EndOffset(space))); | 993 lw(TMP, Address(temp_reg, Heap::EndOffset(space))); |
| 994 // Fail if heap end unsigned less than or equal to instance_reg. | 994 // Fail if heap end unsigned less than or equal to instance_reg. |
| 995 BranchUnsignedLessEqual(TMP, instance_reg, failure); | 995 BranchUnsignedLessEqual(TMP, instance_reg, failure); |
| 996 | 996 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1020 Register end_address, | 1020 Register end_address, |
| 1021 Register temp1, | 1021 Register temp1, |
| 1022 Register temp2) { | 1022 Register temp2) { |
| 1023 if (FLAG_inline_alloc) { | 1023 if (FLAG_inline_alloc) { |
| 1024 // If this allocation is traced, program will jump to failure path | 1024 // If this allocation is traced, program will jump to failure path |
| 1025 // (i.e. the allocation stub) which will allocate the object and trace the | 1025 // (i.e. the allocation stub) which will allocate the object and trace the |
| 1026 // allocation call site. | 1026 // allocation call site. |
| 1027 MaybeTraceAllocation(cid, temp1, failure); | 1027 MaybeTraceAllocation(cid, temp1, failure); |
| 1028 Isolate* isolate = Isolate::Current(); | 1028 Isolate* isolate = Isolate::Current(); |
| 1029 Heap* heap = isolate->heap(); | 1029 Heap* heap = isolate->heap(); |
| 1030 Heap::Space space = heap->SpaceForAllocation(cid); | 1030 Heap::Space space = Heap::kNew; |
| 1031 lw(temp1, Address(THR, Thread::heap_offset())); | 1031 lw(temp1, Address(THR, Thread::heap_offset())); |
| 1032 // Potential new object start. | 1032 // Potential new object start. |
| 1033 lw(instance, Address(temp1, heap->TopOffset(space))); | 1033 lw(instance, Address(temp1, heap->TopOffset(space))); |
| 1034 // Potential next object start. | 1034 // Potential next object start. |
| 1035 AddImmediate(end_address, instance, instance_size); | 1035 AddImmediate(end_address, instance, instance_size); |
| 1036 // Branch on unsigned overflow. | 1036 // Branch on unsigned overflow. |
| 1037 BranchUnsignedLess(end_address, instance, failure); | 1037 BranchUnsignedLess(end_address, instance, failure); |
| 1038 | 1038 |
| 1039 // Check if the allocation fits into the remaining space. | 1039 // Check if the allocation fits into the remaining space. |
| 1040 // instance: potential new object start, /* inline_isolate = */ false. | 1040 // instance: potential new object start, /* inline_isolate = */ false. |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 Label stop; | 1306 Label stop; |
| 1307 b(&stop); | 1307 b(&stop); |
| 1308 Emit(reinterpret_cast<int32_t>(message)); | 1308 Emit(reinterpret_cast<int32_t>(message)); |
| 1309 Bind(&stop); | 1309 Bind(&stop); |
| 1310 break_(Instr::kStopMessageCode); | 1310 break_(Instr::kStopMessageCode); |
| 1311 } | 1311 } |
| 1312 | 1312 |
| 1313 } // namespace dart | 1313 } // namespace dart |
| 1314 | 1314 |
| 1315 #endif // defined TARGET_ARCH_MIPS | 1315 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |