| OLD | NEW |
| 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/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
| 10 #include "vm/native_entry.h" | 10 #include "vm/native_entry.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 DEFINE_NATIVE_ENTRY(Integer_greaterThanFromInteger, 2) { | 159 DEFINE_NATIVE_ENTRY(Integer_greaterThanFromInteger, 2) { |
| 160 const Integer& right = Integer::CheckedHandle(arguments->NativeArgAt(0)); | 160 const Integer& right = Integer::CheckedHandle(arguments->NativeArgAt(0)); |
| 161 GET_NON_NULL_NATIVE_ARGUMENT(Integer, left, arguments->NativeArgAt(1)); | 161 GET_NON_NULL_NATIVE_ARGUMENT(Integer, left, arguments->NativeArgAt(1)); |
| 162 ASSERT(CheckInteger(right)); | 162 ASSERT(CheckInteger(right)); |
| 163 ASSERT(CheckInteger(left)); | 163 ASSERT(CheckInteger(left)); |
| 164 if (FLAG_trace_intrinsified_natives) { | 164 if (FLAG_trace_intrinsified_natives) { |
| 165 OS::Print("Integer_greaterThanFromInteger %s > %s\n", | 165 OS::Print("Integer_greaterThanFromInteger %s > %s\n", |
| 166 left.ToCString(), right.ToCString()); | 166 left.ToCString(), right.ToCString()); |
| 167 } | 167 } |
| 168 return Bool::Get(left.CompareWith(right) == 1); | 168 return Bool::Get(left.CompareWith(right) == 1).raw(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 | 171 |
| 172 DEFINE_NATIVE_ENTRY(Integer_equalToInteger, 2) { | 172 DEFINE_NATIVE_ENTRY(Integer_equalToInteger, 2) { |
| 173 const Integer& left = Integer::CheckedHandle(arguments->NativeArgAt(0)); | 173 const Integer& left = Integer::CheckedHandle(arguments->NativeArgAt(0)); |
| 174 GET_NON_NULL_NATIVE_ARGUMENT(Integer, right, arguments->NativeArgAt(1)); | 174 GET_NON_NULL_NATIVE_ARGUMENT(Integer, right, arguments->NativeArgAt(1)); |
| 175 ASSERT(CheckInteger(left)); | 175 ASSERT(CheckInteger(left)); |
| 176 ASSERT(CheckInteger(right)); | 176 ASSERT(CheckInteger(right)); |
| 177 if (FLAG_trace_intrinsified_natives) { | 177 if (FLAG_trace_intrinsified_natives) { |
| 178 OS::Print("Integer_equalToInteger %s == %s\n", | 178 OS::Print("Integer_equalToInteger %s == %s\n", |
| 179 left.ToCString(), right.ToCString()); | 179 left.ToCString(), right.ToCString()); |
| 180 } | 180 } |
| 181 return Bool::Get(left.CompareWith(right) == 0); | 181 return Bool::Get(left.CompareWith(right) == 0).raw(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 | 184 |
| 185 DEFINE_NATIVE_ENTRY(Integer_parse, 1) { | 185 DEFINE_NATIVE_ENTRY(Integer_parse, 1) { |
| 186 GET_NON_NULL_NATIVE_ARGUMENT(String, value, arguments->NativeArgAt(0)); | 186 GET_NON_NULL_NATIVE_ARGUMENT(String, value, arguments->NativeArgAt(0)); |
| 187 if (value.IsOneByteString()) { | 187 if (value.IsOneByteString()) { |
| 188 // Quick conversion for unpadded integers in strings. | 188 // Quick conversion for unpadded integers in strings. |
| 189 const intptr_t len = value.Length(); | 189 const intptr_t len = value.Length(); |
| 190 if (len > 0) { | 190 if (len > 0) { |
| 191 const char* cstr = value.ToCString(); | 191 const char* cstr = value.ToCString(); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 // Use the preallocated out of memory exception to avoid calling | 369 // Use the preallocated out of memory exception to avoid calling |
| 370 // into dart code or allocating any code. | 370 // into dart code or allocating any code. |
| 371 const Instance& exception = | 371 const Instance& exception = |
| 372 Instance::Handle(isolate->object_store()->out_of_memory()); | 372 Instance::Handle(isolate->object_store()->out_of_memory()); |
| 373 Exceptions::Throw(exception); | 373 Exceptions::Throw(exception); |
| 374 UNREACHABLE(); | 374 UNREACHABLE(); |
| 375 return 0; | 375 return 0; |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace dart | 378 } // namespace dart |
| OLD | NEW |