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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 1289813005: Use Object::null_instance and Object::null_function and do not create Handles everytime. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-patch Created 5 years, 4 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
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 5168 matching lines...) Expand 10 before | Expand all | Expand 10 after
5179 lib.SetLoadInProgress(); 5179 lib.SetLoadInProgress();
5180 } 5180 }
5181 ASSERT(isolate != NULL); 5181 ASSERT(isolate != NULL);
5182 const Error& error = Error::Handle(isolate, Compiler::Compile(lib, script)); 5182 const Error& error = Error::Handle(isolate, Compiler::Compile(lib, script));
5183 if (error.IsNull()) { 5183 if (error.IsNull()) {
5184 *result = Api::NewHandle(isolate, lib.raw()); 5184 *result = Api::NewHandle(isolate, lib.raw());
5185 } else { 5185 } else {
5186 *result = Api::NewHandle(isolate, error.raw()); 5186 *result = Api::NewHandle(isolate, error.raw());
5187 // Compilation errors are not Dart instances, so just mark the library 5187 // Compilation errors are not Dart instances, so just mark the library
5188 // as having failed to load without providing an error instance. 5188 // as having failed to load without providing an error instance.
5189 lib.SetLoadError(Instance::Handle()); 5189 lib.SetLoadError(Object::null_instance());
5190 } 5190 }
5191 } 5191 }
5192 5192
5193 5193
5194 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, 5194 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url,
5195 Dart_Handle source, 5195 Dart_Handle source,
5196 intptr_t line_offset, 5196 intptr_t line_offset,
5197 intptr_t column_offset) { 5197 intptr_t column_offset) {
5198 Isolate* isolate = Isolate::Current(); 5198 Isolate* isolate = Isolate::Current();
5199 DARTSCOPE(isolate); 5199 DARTSCOPE(isolate);
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
6017 ASSERT(stream != NULL); 6017 ASSERT(stream != NULL);
6018 TimelineEvent* event = stream->StartEvent(); 6018 TimelineEvent* event = stream->StartEvent();
6019 if (event != NULL) { 6019 if (event != NULL) {
6020 event->AsyncEnd(label, async_id); 6020 event->AsyncEnd(label, async_id);
6021 event->Complete(); 6021 event->Complete();
6022 } 6022 }
6023 return Api::Success(); 6023 return Api::Success();
6024 } 6024 }
6025 6025
6026 } // namespace dart 6026 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698