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

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

Issue 12318031: Move json, uri, utf and crypto libraries into the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/builtin.h ('k') | runtime/bin/builtin_gen_snapshot.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) 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 #include <stdio.h> 5 #include <stdio.h>
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "bin/builtin.h" 9 #include "bin/builtin.h"
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
11 #include "bin/io_natives.h" 11 #include "bin/io_natives.h"
12 12
13 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = { 13 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
14 /* { url_, source_, patch_url_, patch_source_, has_natives_ } */ 14 /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
15 { DartUtils::kBuiltinLibURL, builtin_source_, NULL, NULL, true }, 15 { DartUtils::kBuiltinLibURL, builtin_source_, NULL, NULL, true },
16 { DartUtils::kJsonLibURL, json_source_, NULL, NULL, false },
17 { DartUtils::kUriLibURL, uri_source_, NULL, NULL, false },
18 { DartUtils::kCryptoLibURL, crypto_source_, NULL, NULL, false },
19 { DartUtils::kIOLibURL, io_source_, 16 { DartUtils::kIOLibURL, io_source_,
20 DartUtils::kIOLibPatchURL, io_patch_, true }, 17 DartUtils::kIOLibPatchURL, io_patch_, true },
21 { DartUtils::kUtfLibURL, utf_source_, NULL, NULL, false }
22 }; 18 };
23 19
24 20
25 Dart_Handle Builtin::Source(BuiltinLibraryId id) { 21 Dart_Handle Builtin::Source(BuiltinLibraryId id) {
26 ASSERT((sizeof(builtin_libraries_) / sizeof(builtin_lib_props)) == 22 ASSERT((sizeof(builtin_libraries_) / sizeof(builtin_lib_props)) ==
27 kInvalidLibrary); 23 kInvalidLibrary);
28 ASSERT(id >= kBuiltinLibrary && id < kInvalidLibrary); 24 ASSERT(id >= kBuiltinLibrary && id < kInvalidLibrary);
29 return DartUtils::NewString(builtin_libraries_[id].source_); 25 return DartUtils::NewString(builtin_libraries_[id].source_);
30 } 26 }
31 27
(...skipping 29 matching lines...) Expand all
61 Dart_Handle patch_url = 57 Dart_Handle patch_url =
62 DartUtils::NewString(builtin_libraries_[id].patch_url_); 58 DartUtils::NewString(builtin_libraries_[id].patch_url_);
63 Dart_Handle patch_source = 59 Dart_Handle patch_source =
64 DartUtils::NewString(builtin_libraries_[id].patch_source_); 60 DartUtils::NewString(builtin_libraries_[id].patch_source_);
65 DART_CHECK_VALID(Dart_LoadPatch(library, patch_url, patch_source)); 61 DART_CHECK_VALID(Dart_LoadPatch(library, patch_url, patch_source));
66 } 62 }
67 } 63 }
68 DART_CHECK_VALID(library); 64 DART_CHECK_VALID(library);
69 return library; 65 return library;
70 } 66 }
OLDNEW
« no previous file with comments | « runtime/bin/builtin.h ('k') | runtime/bin/builtin_gen_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698