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

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

Issue 2774233003: Cleanups needed for async step-out (Closed)
Patch Set: Created 3 years, 8 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
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 "vm/object_store.h" 5 #include "vm/object_store.h"
6 6
7 #include "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 preallocated_stack_trace_(StackTrace::null()), 90 preallocated_stack_trace_(StackTrace::null()),
91 lookup_port_handler_(Function::null()), 91 lookup_port_handler_(Function::null()),
92 empty_uint32_array_(TypedData::null()), 92 empty_uint32_array_(TypedData::null()),
93 handle_message_function_(Function::null()), 93 handle_message_function_(Function::null()),
94 simple_instance_of_function_(Function::null()), 94 simple_instance_of_function_(Function::null()),
95 simple_instance_of_true_function_(Function::null()), 95 simple_instance_of_true_function_(Function::null()),
96 simple_instance_of_false_function_(Function::null()), 96 simple_instance_of_false_function_(Function::null()),
97 async_clear_thread_stack_trace_(Function::null()), 97 async_clear_thread_stack_trace_(Function::null()),
98 async_set_thread_stack_trace_(Function::null()), 98 async_set_thread_stack_trace_(Function::null()),
99 async_star_move_next_helper_(Function::null()), 99 async_star_move_next_helper_(Function::null()),
100 complete_on_async_return_(Function::null()),
101 async_star_stream_controller_(Class::null()),
100 library_load_error_table_(Array::null()), 102 library_load_error_table_(Array::null()),
101 unique_dynamic_targets_(Array::null()), 103 unique_dynamic_targets_(Array::null()),
102 token_objects_(GrowableObjectArray::null()), 104 token_objects_(GrowableObjectArray::null()),
103 token_objects_map_(Array::null()), 105 token_objects_map_(Array::null()),
104 megamorphic_cache_table_(GrowableObjectArray::null()), 106 megamorphic_cache_table_(GrowableObjectArray::null()),
105 megamorphic_miss_code_(Code::null()), 107 megamorphic_miss_code_(Code::null()),
106 megamorphic_miss_function_(Function::null()) { 108 megamorphic_miss_function_(Function::null()) {
107 for (RawObject** current = from(); current <= to(); current++) { 109 for (RawObject** current = from(); current <= to(); current++) {
108 ASSERT(*current == Object::null()); 110 ASSERT(*current == Object::null());
109 } 111 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 function_name, 1, Object::null_array()); 251 function_name, 1, Object::null_array());
250 set_async_set_thread_stack_trace(function); 252 set_async_set_thread_stack_trace(function);
251 253
252 function_name ^= async_lib.PrivateName(Symbols::ClearAsyncThreadStackTrace()); 254 function_name ^= async_lib.PrivateName(Symbols::ClearAsyncThreadStackTrace());
253 ASSERT(!function_name.IsNull()); 255 ASSERT(!function_name.IsNull());
254 function ^= Resolver::ResolveStatic(async_lib, Object::null_string(), 256 function ^= Resolver::ResolveStatic(async_lib, Object::null_string(),
255 function_name, 0, Object::null_array()); 257 function_name, 0, Object::null_array());
256 ASSERT(!function.IsNull()); 258 ASSERT(!function.IsNull());
257 set_async_clear_thread_stack_trace(function); 259 set_async_clear_thread_stack_trace(function);
258 260
261
259 function_name ^= async_lib.PrivateName(Symbols::AsyncStarMoveNextHelper()); 262 function_name ^= async_lib.PrivateName(Symbols::AsyncStarMoveNextHelper());
260 ASSERT(!function_name.IsNull()); 263 ASSERT(!function_name.IsNull());
261 function ^= Resolver::ResolveStatic(async_lib, Object::null_string(), 264 function ^= Resolver::ResolveStatic(async_lib, Object::null_string(),
262 function_name, 1, Object::null_array()); 265 function_name, 1, Object::null_array());
263 ASSERT(!function.IsNull()); 266 ASSERT(!function.IsNull());
264 set_async_star_move_next_helper(function); 267 set_async_star_move_next_helper(function);
265 268
269 function_name ^= async_lib.PrivateName(Symbols::_CompleteOnAsyncReturn());
270 ASSERT(!function_name.IsNull());
271 function ^= Resolver::ResolveStatic(async_lib, Object::null_string(),
272 function_name, 2, Object::null_array());
273 ASSERT(!function.IsNull());
274 set_complete_on_async_return(function);
275 if (FLAG_async_debugger_stepping) {
276 // Disable debugging and inlining the _CompleteOnAsyncReturn function.
277 function.set_is_debuggable(false);
278 function.set_is_inlinable(false);
279 }
280
281 cls =
282 async_lib.LookupClassAllowPrivate(Symbols::_AsyncStarStreamController());
283 ASSERT(!cls.IsNull());
284 set_async_star_stream_controller(cls);
285
286 if (FLAG_async_debugger_stepping) {
287 // Disable debugging and inlining of all functions on the
288 // _AsyncStarStreamController class.
289 const Array& functions = Array::Handle(cls.functions());
290 for (intptr_t i = 0; i < functions.Length(); i++) {
291 function ^= functions.At(i);
292 if (function.IsNull()) {
293 break;
294 }
295 function.set_is_debuggable(false);
296 function.set_is_inlinable(false);
297 }
298 }
299
266 const Library& internal_lib = Library::Handle(_internal_library()); 300 const Library& internal_lib = Library::Handle(_internal_library());
267 cls = internal_lib.LookupClass(Symbols::Symbol()); 301 cls = internal_lib.LookupClass(Symbols::Symbol());
268 set_symbol_class(cls); 302 set_symbol_class(cls);
269 303
270 const Library& core_lib = Library::Handle(core_library()); 304 const Library& core_lib = Library::Handle(core_library());
271 cls = core_lib.LookupClassAllowPrivate(Symbols::_CompileTimeError()); 305 cls = core_lib.LookupClassAllowPrivate(Symbols::_CompileTimeError());
272 ASSERT(!cls.IsNull()); 306 ASSERT(!cls.IsNull());
273 set_compiletime_error_class(cls); 307 set_compiletime_error_class(cls);
274 308
275 // Cache the core private functions used for fast instance of checks. 309 // Cache the core private functions used for fast instance of checks.
276 simple_instance_of_function_ = 310 simple_instance_of_function_ =
277 PrivateObjectLookup(Symbols::_simpleInstanceOf()); 311 PrivateObjectLookup(Symbols::_simpleInstanceOf());
278 simple_instance_of_true_function_ = 312 simple_instance_of_true_function_ =
279 PrivateObjectLookup(Symbols::_simpleInstanceOfTrue()); 313 PrivateObjectLookup(Symbols::_simpleInstanceOfTrue());
280 simple_instance_of_false_function_ = 314 simple_instance_of_false_function_ =
281 PrivateObjectLookup(Symbols::_simpleInstanceOfFalse()); 315 PrivateObjectLookup(Symbols::_simpleInstanceOfFalse());
282 #endif 316 #endif
283 } 317 }
284 318
285 } // namespace dart 319 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698