Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: runtime/lib/object.cc

Issue 345223003: Add VM internal Dart class 'ClassID' used to manage class-ids of known classes. Next CL: add consta… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/internal_sources.gypi ('k') | runtime/lib/object_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/lib/internal_sources.gypi ('k') | runtime/lib/object_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698