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

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

Issue 2697193008: [Kernel] replace function debuggable field with originalAsyncMarker field (Closed)
Patch Set: Changes based on feedback Created 3 years, 10 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/kernel_binary.cc ('k') | runtime/vm/kernel_to_il.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/kernel_reader.h" 5 #include "vm/kernel_reader.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 dart::Function& function = dart::Function::ZoneHandle( 420 dart::Function& function = dart::Function::ZoneHandle(
421 Z, Function::New(name, GetFunctionType(kernel_procedure), 421 Z, Function::New(name, GetFunctionType(kernel_procedure),
422 !is_method, // is_static 422 !is_method, // is_static
423 false, // is_const 423 false, // is_const
424 is_abstract, is_external, 424 is_abstract, is_external,
425 native_name != NULL, // is_native 425 native_name != NULL, // is_native
426 script_class, kernel_procedure->position())); 426 script_class, kernel_procedure->position()));
427 function.set_end_token_pos(kernel_procedure->end_position()); 427 function.set_end_token_pos(kernel_procedure->end_position());
428 owner.AddFunction(function); 428 owner.AddFunction(function);
429 function.set_kernel_function(kernel_procedure); 429 function.set_kernel_function(kernel_procedure);
430 function.set_is_debuggable(kernel_procedure->function()->debuggable()); 430
431 function.set_is_debuggable(
432 kernel_procedure->function()->dart_async_marker() == FunctionNode::kSync);
433 switch (kernel_procedure->function()->dart_async_marker()) {
434 case FunctionNode::kSyncStar:
435 function.set_modifier(RawFunction::kSyncGen);
436 break;
437 case FunctionNode::kAsync:
438 function.set_modifier(RawFunction::kAsync);
439 break;
440 case FunctionNode::kAsyncStar:
441 function.set_modifier(RawFunction::kAsyncGen);
442 break;
443 default:
444 // no special modifier
445 break;
446 }
447 function.set_is_generated_body(kernel_procedure->function()->async_marker() ==
Kevin Millikin (Google) 2017/02/22 10:46:03 This is safe but we won't see kSyncYielding here s
jensj 2017/02/22 11:12:35 Changing to ``` ASSERT(kernel_procedure->function(
448 FunctionNode::kSyncYielding);
449
431 if (native_name != NULL) { 450 if (native_name != NULL) {
432 function.set_native_name(*native_name); 451 function.set_native_name(*native_name);
433 } 452 }
434 453
435 SetupFunctionParameters(H, T, owner, function, kernel_procedure->function(), 454 SetupFunctionParameters(H, T, owner, function, kernel_procedure->function(),
436 is_method, 455 is_method,
437 false); // is_closure 456 false); // is_closure
438 457
439 if (kernel_klass == NULL) { 458 if (kernel_klass == NULL) {
440 library.AddObject(function, name); 459 library.AddObject(function, name);
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 initializer_fun.set_is_debuggable(false); 817 initializer_fun.set_is_debuggable(false);
799 initializer_fun.set_is_reflectable(false); 818 initializer_fun.set_is_reflectable(false);
800 initializer_fun.set_is_inlinable(false); 819 initializer_fun.set_is_inlinable(false);
801 return new (zone) ParsedFunction(thread, initializer_fun); 820 return new (zone) ParsedFunction(thread, initializer_fun);
802 } 821 }
803 822
804 823
805 } // namespace kernel 824 } // namespace kernel
806 } // namespace dart 825 } // namespace dart
807 #endif // !defined(DART_PRECOMPILED_RUNTIME) 826 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/vm/kernel_binary.cc ('k') | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698