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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 11264032: Introduce VM API for the patching mechanism. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Duplicate the code instead to keep error messages. Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index f8c18ed05f9bb276ced8351b1aab8341465704a2..f1acf1c55617c9db862c4d8ac567aa2d93ac84bf 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -4422,6 +4422,34 @@ DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library,
}
+DART_EXPORT Dart_Handle Dart_LoadPatch(Dart_Handle library,
Mads Ager (google) 2012/10/25 10:47:46 This code is completely duplicated from LoadSource
+ Dart_Handle url,
+ Dart_Handle patch_source) {
+ TIMERSCOPE(time_script_loading);
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ if (FLAG_use_cha) {
Ivan Posva 2012/10/26 04:33:34 Leave it like this but note: dartbug.com/6288
+ RemoveOptimizedCode();
+ }
+ const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+ if (lib.IsNull()) {
+ RETURN_TYPE_ERROR(isolate, library, Library);
+ }
+ const String& url_str = Api::UnwrapStringHandle(isolate, url);
+ if (url_str.IsNull()) {
+ RETURN_TYPE_ERROR(isolate, url, String);
+ }
+ const String& source_str = Api::UnwrapStringHandle(isolate, patch_source);
+ if (source_str.IsNull()) {
+ RETURN_TYPE_ERROR(isolate, patch_source, String);
+ }
+ Dart_Handle result;
+ CompileSource(isolate, lib, url_str, source_str,
+ RawScript::kPatchTag, &result);
+ return result;
+}
+
+
DART_EXPORT Dart_Handle Dart_SetNativeResolver(
Dart_Handle library,
Dart_NativeEntryResolver resolver) {
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698