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

Side by Side Diff: runtime/bin/io_natives.cc

Issue 227433004: Add runtime and native entry tags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/bin/io_natives.h ('k') | runtime/bin/test_extension.c » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "bin/io_natives.h" 5 #include "bin/io_natives.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "bin/builtin.h" 10 #include "bin/builtin.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 for (int i = 0; i < num_entries; i++) { 117 for (int i = 0; i < num_entries; i++) {
118 struct NativeEntries* entry = &(IOEntries[i]); 118 struct NativeEntries* entry = &(IOEntries[i]);
119 if (!strcmp(function_name, entry->name_) && 119 if (!strcmp(function_name, entry->name_) &&
120 (entry->argument_count_ == argument_count)) { 120 (entry->argument_count_ == argument_count)) {
121 return reinterpret_cast<Dart_NativeFunction>(entry->function_); 121 return reinterpret_cast<Dart_NativeFunction>(entry->function_);
122 } 122 }
123 } 123 }
124 return NULL; 124 return NULL;
125 } 125 }
126 126
127
128 const uint8_t* IONativeSymbol(Dart_NativeFunction nf) {
129 int num_entries = sizeof(IOEntries) / sizeof(struct NativeEntries);
130 for (int i = 0; i < num_entries; i++) {
131 struct NativeEntries* entry = &(IOEntries[i]);
132 if (reinterpret_cast<Dart_NativeFunction>(entry->function_) == nf) {
133 return reinterpret_cast<const uint8_t*>(entry->name_);
134 }
135 }
136 return NULL;
137 }
138
127 } // namespace bin 139 } // namespace bin
128 } // namespace dart 140 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/io_natives.h ('k') | runtime/bin/test_extension.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698