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

Side by Side Diff: runtime/bin/builtin.h

Issue 9462001: Unify most of our utf8 implementations. This takes the implementation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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
OLDNEW
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 #ifndef BIN_BUILTIN_H_ 5 #ifndef BIN_BUILTIN_H_
6 #define BIN_BUILTIN_H_ 6 #define BIN_BUILTIN_H_
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
11 #include "include/dart_api.h" 11 #include "include/dart_api.h"
12 #include "platform/assert.h" 12 #include "platform/assert.h"
13 #include "platform/globals.h" 13 #include "platform/globals.h"
14 14
15 #define FUNCTION_NAME(name) Builtin_##name 15 #define FUNCTION_NAME(name) Builtin_##name
16 #define REGISTER_FUNCTION(name, count) \ 16 #define REGISTER_FUNCTION(name, count) \
17 { ""#name, FUNCTION_NAME(name), count }, 17 { ""#name, FUNCTION_NAME(name), count },
18 #define DECLARE_FUNCTION(name, count) \ 18 #define DECLARE_FUNCTION(name, count) \
19 extern void FUNCTION_NAME(name)(Dart_NativeArguments args); 19 extern void FUNCTION_NAME(name)(Dart_NativeArguments args);
20 20
21 21
22 class Builtin { 22 class Builtin {
23 public: 23 public:
24 enum BuiltinLibraryId { 24 enum BuiltinLibraryId {
25 kBuiltinLibrary, 25 kBuiltinLibrary,
26 kIOLibrary, 26 kIOLibrary,
27 kJsonLibrary, 27 kJsonLibrary,
28 kUriLibrary, 28 kUriLibrary,
29 kUtf8Library, 29 kUtfLibrary,
30 }; 30 };
31 31
32 static Dart_Handle Source(BuiltinLibraryId id); 32 static Dart_Handle Source(BuiltinLibraryId id);
33 static void SetupLibrary(Dart_Handle library, BuiltinLibraryId id); 33 static void SetupLibrary(Dart_Handle library, BuiltinLibraryId id);
34 static Dart_Handle LoadLibrary(BuiltinLibraryId id); 34 static Dart_Handle LoadLibrary(BuiltinLibraryId id);
35 static void ImportLibrary(Dart_Handle library, BuiltinLibraryId id); 35 static void ImportLibrary(Dart_Handle library, BuiltinLibraryId id);
36 static void SetNativeResolver(BuiltinLibraryId id); 36 static void SetNativeResolver(BuiltinLibraryId id);
37 static void PrintString(FILE* out, Dart_Handle object); 37 static void PrintString(FILE* out, Dart_Handle object);
38 38
39 private: 39 private:
40 static Dart_NativeFunction NativeLookup(Dart_Handle name, 40 static Dart_NativeFunction NativeLookup(Dart_Handle name,
41 int argument_count); 41 int argument_count);
42 42
43 static const char builtin_source_[]; 43 static const char builtin_source_[];
44 static const char io_source_[]; 44 static const char io_source_[];
45 static const char json_source_[]; 45 static const char json_source_[];
46 static const char uri_source_[]; 46 static const char uri_source_[];
47 static const char utf8_source_[]; 47 static const char utf_source_[];
48 48
49 DISALLOW_ALLOCATION(); 49 DISALLOW_ALLOCATION();
50 DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin); 50 DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin);
51 }; 51 };
52 52
53 53
54 #endif // BIN_BUILTIN_H_ 54 #endif // BIN_BUILTIN_H_
OLDNEW
« lib/utf/utf_vm.dart ('K') | « runtime/bin/bin.gypi ('k') | runtime/bin/builtin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698