| OLD | NEW |
| 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 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Setup native resolver method built in library specified in 'id'. | 43 // Setup native resolver method built in library specified in 'id'. |
| 44 static void SetNativeResolver(BuiltinLibraryId id); | 44 static void SetNativeResolver(BuiltinLibraryId id); |
| 45 | 45 |
| 46 static Dart_Handle LoadLibrary(Dart_Handle url, BuiltinLibraryId id); | 46 static Dart_Handle LoadLibrary(Dart_Handle url, BuiltinLibraryId id); |
| 47 | 47 |
| 48 // Check if built in library specified in 'id' is already loaded, if not | 48 // Check if built in library specified in 'id' is already loaded, if not |
| 49 // load it. | 49 // load it. |
| 50 static Dart_Handle LoadAndCheckLibrary(BuiltinLibraryId id); | 50 static Dart_Handle LoadAndCheckLibrary(BuiltinLibraryId id); |
| 51 | 51 |
| 52 static void SetLoadPort(Dart_Port port); | |
| 53 | |
| 54 private: | 52 private: |
| 55 // Map specified URI to an actual file name from 'source_paths' and read | 53 // Map specified URI to an actual file name from 'source_paths' and read |
| 56 // the file. | 54 // the file. |
| 57 static Dart_Handle GetSource(const char** source_paths, const char* uri); | 55 static Dart_Handle GetSource(const char** source_paths, const char* uri); |
| 58 | 56 |
| 59 // Native method support. | 57 // Native method support. |
| 60 static Dart_NativeFunction NativeLookup(Dart_Handle name, | 58 static Dart_NativeFunction NativeLookup(Dart_Handle name, |
| 61 int argument_count, | 59 int argument_count, |
| 62 bool* auto_setup_scope); | 60 bool* auto_setup_scope); |
| 63 | 61 |
| 64 static const uint8_t* NativeSymbol(Dart_NativeFunction nf); | 62 static const uint8_t* NativeSymbol(Dart_NativeFunction nf); |
| 65 | 63 |
| 66 static const char* _builtin_source_paths_[]; | 64 static const char* _builtin_source_paths_[]; |
| 67 static const char* io_source_paths_[]; | 65 static const char* io_source_paths_[]; |
| 68 static const char* io_patch_paths_[]; | 66 static const char* io_patch_paths_[]; |
| 69 static Dart_Port load_port_; | |
| 70 | 67 |
| 71 typedef struct { | 68 typedef struct { |
| 72 const char* url_; | 69 const char* url_; |
| 73 const char** source_paths_; | 70 const char** source_paths_; |
| 74 const char* patch_url_; | 71 const char* patch_url_; |
| 75 const char** patch_paths_; | 72 const char** patch_paths_; |
| 76 bool has_natives_; | 73 bool has_natives_; |
| 77 } builtin_lib_props; | 74 } builtin_lib_props; |
| 78 static builtin_lib_props builtin_libraries_[]; | 75 static builtin_lib_props builtin_libraries_[]; |
| 79 | 76 |
| 80 DISALLOW_ALLOCATION(); | 77 DISALLOW_ALLOCATION(); |
| 81 DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin); | 78 DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin); |
| 82 }; | 79 }; |
| 83 | 80 |
| 84 } // namespace bin | 81 } // namespace bin |
| 85 } // namespace dart | 82 } // namespace dart |
| 86 | 83 |
| 87 #endif // BIN_BUILTIN_H_ | 84 #endif // BIN_BUILTIN_H_ |
| OLD | NEW |