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

Side by Side Diff: runtime/vm/native_entry.h

Issue 1012333002: Keep zone cached in SnapshotReader to allow removing ZoneHandle(Isolate*) interface. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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/vm/isolate.cc ('k') | runtime/vm/native_entry_test.cc » ('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 #ifndef VM_NATIVE_ENTRY_H_ 5 #ifndef VM_NATIVE_ENTRY_H_
6 #define VM_NATIVE_ENTRY_H_ 6 #define VM_NATIVE_ENTRY_H_
7 7
8 #include "platform/memory_sanitizer.h" 8 #include "platform/memory_sanitizer.h"
9 9
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 static RawObject* DN_Helper##name(Isolate* isolate, \ 67 static RawObject* DN_Helper##name(Isolate* isolate, \
68 Thread* thread, \ 68 Thread* thread, \
69 Zone* zone, \ 69 Zone* zone, \
70 NativeArguments* arguments) 70 NativeArguments* arguments)
71 71
72 72
73 // Natives should throw an exception if an illegal argument or null is passed. 73 // Natives should throw an exception if an illegal argument or null is passed.
74 // type name = value. 74 // type name = value.
75 #define GET_NON_NULL_NATIVE_ARGUMENT(type, name, value) \ 75 #define GET_NON_NULL_NATIVE_ARGUMENT(type, name, value) \
76 const Instance& __##name##_instance__ = \ 76 const Instance& __##name##_instance__ = \
77 Instance::CheckedHandle(isolate, value); \ 77 Instance::CheckedHandle(zone, value); \
78 if (!__##name##_instance__.Is##type()) { \ 78 if (!__##name##_instance__.Is##type()) { \
79 const Array& __args__ = Array::Handle(Array::New(1)); \ 79 const Array& __args__ = Array::Handle(Array::New(1)); \
80 __args__.SetAt(0, __##name##_instance__); \ 80 __args__.SetAt(0, __##name##_instance__); \
81 Exceptions::ThrowByType(Exceptions::kArgument, __args__); \ 81 Exceptions::ThrowByType(Exceptions::kArgument, __args__); \
82 } \ 82 } \
83 const type& name = type::Cast(__##name##_instance__); 83 const type& name = type::Cast(__##name##_instance__);
84 84
85 85
86 // Natives should throw an exception if an illegal argument is passed. 86 // Natives should throw an exception if an illegal argument is passed.
87 // type name = value. 87 // type name = value.
88 #define GET_NATIVE_ARGUMENT(type, name, value) \ 88 #define GET_NATIVE_ARGUMENT(type, name, value) \
89 const Instance& __##name##_instance__ = \ 89 const Instance& __##name##_instance__ = \
90 Instance::CheckedHandle(isolate, value); \ 90 Instance::CheckedHandle(zone, value); \
91 type& name = type::Handle(isolate); \ 91 type& name = type::Handle(isolate); \
92 if (!__##name##_instance__.IsNull()) { \ 92 if (!__##name##_instance__.IsNull()) { \
93 if (!__##name##_instance__.Is##type()) { \ 93 if (!__##name##_instance__.Is##type()) { \
94 const Array& __args__ = Array::Handle(Array::New(1)); \ 94 const Array& __args__ = Array::Handle(Array::New(1)); \
95 __args__.SetAt(0, __##name##_instance__); \ 95 __args__.SetAt(0, __##name##_instance__); \
96 Exceptions::ThrowByType(Exceptions::kArgument, __args__); \ 96 Exceptions::ThrowByType(Exceptions::kArgument, __args__); \
97 } \ 97 } \
98 } \ 98 } \
99 name ^= value; 99 name ^= value;
100 100
(...skipping 12 matching lines...) Expand all
113 uword pc); 113 uword pc);
114 static const uint8_t* ResolveSymbol(uword pc); 114 static const uint8_t* ResolveSymbol(uword pc);
115 static void NativeCallWrapper(Dart_NativeArguments args, 115 static void NativeCallWrapper(Dart_NativeArguments args,
116 Dart_NativeFunction func); 116 Dart_NativeFunction func);
117 static const ExternalLabel& NativeCallWrapperLabel(); 117 static const ExternalLabel& NativeCallWrapperLabel();
118 }; 118 };
119 119
120 } // namespace dart 120 } // namespace dart
121 121
122 #endif // VM_NATIVE_ENTRY_H_ 122 #endif // VM_NATIVE_ENTRY_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/native_entry_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698