| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 DECLARE_FLAG(bool, warn_on_javascript_compatibility); | 21 DECLARE_FLAG(bool, warn_on_javascript_compatibility); |
| 22 | 22 |
| 23 | 23 |
| 24 DEFINE_NATIVE_ENTRY(Object_equals, 1) { | 24 DEFINE_NATIVE_ENTRY(Object_equals, 1) { |
| 25 // Implemented in the flow graph builder. | 25 // Implemented in the flow graph builder. |
| 26 UNREACHABLE(); | 26 UNREACHABLE(); |
| 27 return Object::null(); | 27 return Object::null(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 | 30 |
| 31 DEFINE_NATIVE_ENTRY(Object_cid, 1) { | |
| 32 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0)); | |
| 33 return Smi::New(instance.GetClassId()); | |
| 34 } | |
| 35 | |
| 36 | |
| 37 DEFINE_NATIVE_ENTRY(Object_getHash, 1) { | 31 DEFINE_NATIVE_ENTRY(Object_getHash, 1) { |
| 38 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0)); | 32 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0)); |
| 39 Heap* heap = isolate->heap(); | 33 Heap* heap = isolate->heap(); |
| 40 return Smi::New(heap->GetHash(instance.raw())); | 34 return Smi::New(heap->GetHash(instance.raw())); |
| 41 } | 35 } |
| 42 | 36 |
| 43 | 37 |
| 44 DEFINE_NATIVE_ENTRY(Object_setHash, 2) { | 38 DEFINE_NATIVE_ENTRY(Object_setHash, 2) { |
| 45 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0)); | 39 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0)); |
| 46 GET_NON_NULL_NATIVE_ARGUMENT(Smi, hash, arguments->NativeArgAt(1)); | 40 GET_NON_NULL_NATIVE_ARGUMENT(Smi, hash, arguments->NativeArgAt(1)); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 284 |
| 291 | 285 |
| 292 DEFINE_NATIVE_ENTRY(LibraryPrefix_load, 1) { | 286 DEFINE_NATIVE_ENTRY(LibraryPrefix_load, 1) { |
| 293 const LibraryPrefix& prefix = | 287 const LibraryPrefix& prefix = |
| 294 LibraryPrefix::CheckedHandle(arguments->NativeArgAt(0)); | 288 LibraryPrefix::CheckedHandle(arguments->NativeArgAt(0)); |
| 295 bool hasCompleted = prefix.LoadLibrary(); | 289 bool hasCompleted = prefix.LoadLibrary(); |
| 296 return Bool::Get(hasCompleted).raw(); | 290 return Bool::Get(hasCompleted).raw(); |
| 297 } | 291 } |
| 298 | 292 |
| 299 } // namespace dart | 293 } // namespace dart |
| OLD | NEW |