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

Side by Side Diff: vm/dart_api_impl.cc

Issue 10386073: Revert change 7506 to check on build failure. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | « include/dart_api.h ('k') | vm/dart_api_impl_test.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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); 2987 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
2988 Isolate* isolate = arguments->isolate(); 2988 Isolate* isolate = arguments->isolate();
2989 DARTSCOPE(isolate); 2989 DARTSCOPE(isolate);
2990 arguments->SetReturn(Object::Handle(isolate, Api::UnwrapHandle(retval))); 2990 arguments->SetReturn(Object::Handle(isolate, Api::UnwrapHandle(retval)));
2991 } 2991 }
2992 2992
2993 2993
2994 // --- Scripts and Libraries --- 2994 // --- Scripts and Libraries ---
2995 2995
2996 2996
2997 DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler(
2998 Dart_LibraryTagHandler handler) {
2999 Isolate* isolate = Isolate::Current();
3000 CHECK_ISOLATE(isolate);
3001 isolate->set_library_tag_handler(handler);
3002 return Api::Success(isolate);
3003 }
3004
3005
3006 // NOTE: Need to pass 'result' as a parameter here in order to avoid 2997 // NOTE: Need to pass 'result' as a parameter here in order to avoid
3007 // warning: variable 'result' might be clobbered by 'longjmp' or 'vfork' 2998 // warning: variable 'result' might be clobbered by 'longjmp' or 'vfork'
3008 // which shows up because of the use of setjmp. 2999 // which shows up because of the use of setjmp.
3009 static void CompileSource(Isolate* isolate, 3000 static void CompileSource(Isolate* isolate,
3010 const Library& lib, 3001 const Library& lib,
3011 const String& url, 3002 const String& url,
3012 const String& source, 3003 const String& source,
3013 RawScript::Kind kind, 3004 RawScript::Kind kind,
3014 Dart_Handle* result) { 3005 Dart_Handle* result) {
3015 bool update_lib_status = (kind == RawScript::kScript || 3006 bool update_lib_status = (kind == RawScript::kScript ||
(...skipping 14 matching lines...) Expand all
3030 *result = Api::NewHandle(isolate, error.raw()); 3021 *result = Api::NewHandle(isolate, error.raw());
3031 if (update_lib_status) { 3022 if (update_lib_status) {
3032 lib.SetLoadError(); 3023 lib.SetLoadError();
3033 } 3024 }
3034 } 3025 }
3035 } 3026 }
3036 3027
3037 3028
3038 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, 3029 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url,
3039 Dart_Handle source, 3030 Dart_Handle source,
3031 Dart_LibraryTagHandler handler,
3040 Dart_Handle import_map) { 3032 Dart_Handle import_map) {
3041 TIMERSCOPE(time_script_loading); 3033 TIMERSCOPE(time_script_loading);
3042 Isolate* isolate = Isolate::Current(); 3034 Isolate* isolate = Isolate::Current();
3043 DARTSCOPE(isolate); 3035 DARTSCOPE(isolate);
3044 const String& url_str = Api::UnwrapStringHandle(isolate, url); 3036 const String& url_str = Api::UnwrapStringHandle(isolate, url);
3045 if (url_str.IsNull()) { 3037 if (url_str.IsNull()) {
3046 RETURN_TYPE_ERROR(isolate, url, String); 3038 RETURN_TYPE_ERROR(isolate, url, String);
3047 } 3039 }
3048 const String& source_str = Api::UnwrapStringHandle(isolate, source); 3040 const String& source_str = Api::UnwrapStringHandle(isolate, source);
3049 if (source_str.IsNull()) { 3041 if (source_str.IsNull()) {
3050 RETURN_TYPE_ERROR(isolate, source, String); 3042 RETURN_TYPE_ERROR(isolate, source, String);
3051 } 3043 }
3052 const Array& mapping_array = Api::UnwrapArrayHandle(isolate, import_map); 3044 const Array& mapping_array = Api::UnwrapArrayHandle(isolate, import_map);
3053 Library& library = 3045 Library& library =
3054 Library::Handle(isolate, isolate->object_store()->root_library()); 3046 Library::Handle(isolate, isolate->object_store()->root_library());
3055 if (!library.IsNull()) { 3047 if (!library.IsNull()) {
3056 const String& library_url = String::Handle(isolate, library.url()); 3048 const String& library_url = String::Handle(isolate, library.url());
3057 return Api::NewError("%s: A script has already been loaded from '%s'.", 3049 return Api::NewError("%s: A script has already been loaded from '%s'.",
3058 CURRENT_FUNC, library_url.ToCString()); 3050 CURRENT_FUNC, library_url.ToCString());
3059 } 3051 }
3052 isolate->set_library_tag_handler(handler);
3060 library = Library::New(url_str); 3053 library = Library::New(url_str);
3061 if (mapping_array.IsNull()) { 3054 if (mapping_array.IsNull()) {
3062 library.set_import_map(Array::Handle(isolate, Array::Empty())); 3055 library.set_import_map(Array::Handle(isolate, Array::Empty()));
3063 } else { 3056 } else {
3064 library.set_import_map(mapping_array); 3057 library.set_import_map(mapping_array);
3065 } 3058 }
3066 library.Register(); 3059 library.Register();
3067 isolate->object_store()->set_root_library(library); 3060 isolate->object_store()->set_root_library(library);
3068 Dart_Handle result; 3061 Dart_Handle result;
3069 CompileSource(isolate, 3062 CompileSource(isolate,
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
3329 *buffer = NULL; 3322 *buffer = NULL;
3330 } 3323 }
3331 delete debug_region; 3324 delete debug_region;
3332 } else { 3325 } else {
3333 *buffer = NULL; 3326 *buffer = NULL;
3334 *buffer_size = 0; 3327 *buffer_size = 0;
3335 } 3328 }
3336 } 3329 }
3337 3330
3338 } // namespace dart 3331 } // namespace dart
OLDNEW
« no previous file with comments | « include/dart_api.h ('k') | vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698