| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #if defined(TARGET_ARCH_DBC) | 9 #if defined(TARGET_ARCH_DBC) |
| 10 | 10 |
| (...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2831 Exit(thread, FP, SP + 3, pc); | 2831 Exit(thread, FP, SP + 3, pc); |
| 2832 NativeArguments args(thread, 2, SP + 1, SP - 1); | 2832 NativeArguments args(thread, 2, SP + 1, SP - 1); |
| 2833 INVOKE_RUNTIME(DRT_AllocateObject, args); | 2833 INVOKE_RUNTIME(DRT_AllocateObject, args); |
| 2834 SP -= 1; // Result is in SP - 1. | 2834 SP -= 1; // Result is in SP - 1. |
| 2835 DISPATCH(); | 2835 DISPATCH(); |
| 2836 } | 2836 } |
| 2837 | 2837 |
| 2838 { | 2838 { |
| 2839 BYTECODE(CreateArrayOpt, A_B_C); | 2839 BYTECODE(CreateArrayOpt, A_B_C); |
| 2840 const intptr_t length = Smi::Value(RAW_CAST(Smi, FP[rB])); | 2840 const intptr_t length = Smi::Value(RAW_CAST(Smi, FP[rB])); |
| 2841 if (LIKELY(length <= Array::kMaxElements)) { | 2841 if (LIKELY(static_cast<uintptr_t>(length) <= Array::kMaxElements)) { |
| 2842 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1; | 2842 const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1; |
| 2843 const intptr_t instance_size = | 2843 const intptr_t instance_size = |
| 2844 (fixed_size + length*kWordSize) & ~(kObjectAlignment - 1); | 2844 (fixed_size + length*kWordSize) & ~(kObjectAlignment - 1); |
| 2845 const uword start = | 2845 const uword start = |
| 2846 thread->heap()->new_space()->TryAllocate(instance_size); | 2846 thread->heap()->new_space()->TryAllocate(instance_size); |
| 2847 if (LIKELY(start != 0)) { | 2847 if (LIKELY(start != 0)) { |
| 2848 const intptr_t cid = kArrayCid; | 2848 const intptr_t cid = kArrayCid; |
| 2849 uword tags = 0; | 2849 uword tags = 0; |
| 2850 if (LIKELY(instance_size < RawObject::SizeTag::kMaxSizeTag)) { | 2850 if (LIKELY(instance_size < RawObject::SizeTag::kMaxSizeTag)) { |
| 2851 tags = RawObject::SizeTag::update(instance_size, tags); | 2851 tags = RawObject::SizeTag::update(instance_size, tags); |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3763 pc_ = pc; | 3763 pc_ = pc; |
| 3764 special_[kExceptionSpecialIndex] = raw_exception; | 3764 special_[kExceptionSpecialIndex] = raw_exception; |
| 3765 special_[kStacktraceSpecialIndex] = raw_stacktrace; | 3765 special_[kStacktraceSpecialIndex] = raw_stacktrace; |
| 3766 buf->Longjmp(); | 3766 buf->Longjmp(); |
| 3767 UNREACHABLE(); | 3767 UNREACHABLE(); |
| 3768 } | 3768 } |
| 3769 | 3769 |
| 3770 } // namespace dart | 3770 } // namespace dart |
| 3771 | 3771 |
| 3772 #endif // defined TARGET_ARCH_DBC | 3772 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |