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

Side by Side Diff: runtime/vm/bootstrap.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 | « no previous file | runtime/vm/class_finalizer.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 "vm/bootstrap.h" 5 #include "vm/bootstrap.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/bootstrap_natives.h" 9 #include "vm/bootstrap_natives.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (update_lib_status) { 147 if (update_lib_status) {
148 library.SetLoadInProgress(); 148 library.SetLoadInProgress();
149 } 149 }
150 const Error& error = Error::Handle(Compiler::Compile(library, script)); 150 const Error& error = Error::Handle(Compiler::Compile(library, script));
151 if (update_lib_status) { 151 if (update_lib_status) {
152 if (error.IsNull()) { 152 if (error.IsNull()) {
153 library.SetLoaded(); 153 library.SetLoaded();
154 } else { 154 } else {
155 // Compilation errors are not Dart instances, so just mark the library 155 // Compilation errors are not Dart instances, so just mark the library
156 // as having failed to load without providing an error instance. 156 // as having failed to load without providing an error instance.
157 library.SetLoadError(Instance::Handle()); 157 library.SetLoadError(Object::null_instance());
158 } 158 }
159 } 159 }
160 return error.raw(); 160 return error.raw();
161 } 161 }
162 162
163 163
164 static Dart_Handle LoadPartSource(Isolate* isolate, 164 static Dart_Handle LoadPartSource(Isolate* isolate,
165 const Library& lib, 165 const Library& lib,
166 const String& uri) { 166 const String& uri) {
167 const String& part_source = String::Handle( 167 const String& part_source = String::Handle(
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 Compiler::CompileClass(cls); 329 Compiler::CompileClass(cls);
330 } 330 }
331 331
332 // Restore the library tag handler for the isolate. 332 // Restore the library tag handler for the isolate.
333 isolate->set_library_tag_handler(saved_tag_handler); 333 isolate->set_library_tag_handler(saved_tag_handler);
334 334
335 return error.raw(); 335 return error.raw();
336 } 336 }
337 337
338 } // namespace dart 338 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698