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

Side by Side Diff: runtime/vm/kernel_binary_flowgraph.h

Issue 3001103002: Do not qualify with dart:: except where necessary (Closed)
Patch Set: Created 3 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/kernel.h ('k') | runtime/vm/kernel_binary_flowgraph.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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 #ifndef RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ 5 #ifndef RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
6 #define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ 6 #define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
7 7
8 #if !defined(DART_PRECOMPILED_RUNTIME) 8 #if !defined(DART_PRECOMPILED_RUNTIME)
9 9
10 #include <map> 10 #include <map>
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 // Is guaranteed to be not malformed. 445 // Is guaranteed to be not malformed.
446 AbstractType& BuildVariableType(); 446 AbstractType& BuildVariableType();
447 447
448 // Will return `TypeArguments::null()` in case any of the arguments are 448 // Will return `TypeArguments::null()` in case any of the arguments are
449 // malformed. 449 // malformed.
450 const TypeArguments& BuildTypeArguments(intptr_t length); 450 const TypeArguments& BuildTypeArguments(intptr_t length);
451 451
452 // Will return `TypeArguments::null()` in case any of the arguments are 452 // Will return `TypeArguments::null()` in case any of the arguments are
453 // malformed. 453 // malformed.
454 const TypeArguments& BuildInstantiatedTypeArguments( 454 const TypeArguments& BuildInstantiatedTypeArguments(
455 const dart::Class& receiver_class, 455 const Class& receiver_class,
456 intptr_t length); 456 intptr_t length);
457 457
458 const Type& ReceiverType(const dart::Class& klass); 458 const Type& ReceiverType(const Class& klass);
459 459
460 private: 460 private:
461 // Can build a malformed type. 461 // Can build a malformed type.
462 void BuildTypeInternal(); 462 void BuildTypeInternal();
463 void BuildInterfaceType(bool simple); 463 void BuildInterfaceType(bool simple);
464 void BuildFunctionType(bool simple); 464 void BuildFunctionType(bool simple);
465 void BuildTypeParameterType(); 465 void BuildTypeParameterType();
466 466
467 class TypeParameterScope { 467 class TypeParameterScope {
468 public: 468 public:
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 */ 543 */
544 void AddPositionalAndNamedParameters(intptr_t pos = 0); 544 void AddPositionalAndNamedParameters(intptr_t pos = 0);
545 /** 545 /**
546 * This assumes that the reader is at a FunctionNode, 546 * This assumes that the reader is at a FunctionNode,
547 * about to read a parameter (i.e. VariableDeclaration). 547 * about to read a parameter (i.e. VariableDeclaration).
548 */ 548 */
549 void AddVariableDeclarationParameter(intptr_t pos); 549 void AddVariableDeclarationParameter(intptr_t pos);
550 550
551 LocalVariable* MakeVariable(TokenPosition declaration_pos, 551 LocalVariable* MakeVariable(TokenPosition declaration_pos,
552 TokenPosition token_pos, 552 TokenPosition token_pos,
553 const dart::String& name, 553 const String& name,
554 const AbstractType& type); 554 const AbstractType& type);
555 555
556 void AddExceptionVariable(GrowableArray<LocalVariable*>* variables, 556 void AddExceptionVariable(GrowableArray<LocalVariable*>* variables,
557 const char* prefix, 557 const char* prefix,
558 intptr_t nesting_depth); 558 intptr_t nesting_depth);
559 559
560 void AddTryVariables(); 560 void AddTryVariables();
561 void AddCatchVariables(); 561 void AddCatchVariables();
562 void AddIteratorVariable(); 562 void AddIteratorVariable();
563 void AddSwitchVariable(); 563 void AddSwitchVariable();
564 564
565 // Record an assignment or reference to a variable. If the occurrence is 565 // Record an assignment or reference to a variable. If the occurrence is
566 // in a nested function, ensure that the variable is handled properly as a 566 // in a nested function, ensure that the variable is handled properly as a
567 // captured variable. 567 // captured variable.
568 void LookupVariable(intptr_t declaration_binary_offset); 568 void LookupVariable(intptr_t declaration_binary_offset);
569 569
570 const dart::String& GenerateName(const char* prefix, intptr_t suffix); 570 const String& GenerateName(const char* prefix, intptr_t suffix);
571 571
572 void HandleSpecialLoad(LocalVariable** variable, const dart::String& symbol); 572 void HandleSpecialLoad(LocalVariable** variable, const String& symbol);
573 void LookupCapturedVariableByName(LocalVariable** variable, 573 void LookupCapturedVariableByName(LocalVariable** variable,
574 const dart::String& name); 574 const String& name);
575 575
576 struct DepthState { 576 struct DepthState {
577 explicit DepthState(intptr_t function) 577 explicit DepthState(intptr_t function)
578 : loop_(0), 578 : loop_(0),
579 function_(function), 579 function_(function),
580 try_(0), 580 try_(0),
581 catch_(0), 581 catch_(0),
582 finally_(0), 582 finally_(0),
583 for_in_(0) {} 583 for_in_(0) {}
584 584
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 672
673 const Object& RunFunction(const Function& function, 673 const Object& RunFunction(const Function& function,
674 intptr_t argument_count, 674 intptr_t argument_count,
675 const Instance* receiver, 675 const Instance* receiver,
676 const TypeArguments* type_args); 676 const TypeArguments* type_args);
677 677
678 const Object& RunFunction(const Function& function, 678 const Object& RunFunction(const Function& function,
679 const Array& arguments, 679 const Array& arguments,
680 const Array& names); 680 const Array& names);
681 681
682 RawObject* EvaluateConstConstructorCall(const dart::Class& type_class, 682 RawObject* EvaluateConstConstructorCall(const Class& type_class,
683 const TypeArguments& type_arguments, 683 const TypeArguments& type_arguments,
684 const Function& constructor, 684 const Function& constructor,
685 const Object& argument); 685 const Object& argument);
686 686
687 const TypeArguments* TranslateTypeArguments(const Function& target, 687 const TypeArguments* TranslateTypeArguments(const Function& target,
688 dart::Class* target_klass); 688 Class* target_klass);
689 689
690 void AssertBool() { 690 void AssertBool() {
691 if (!result_.IsBool()) { 691 if (!result_.IsBool()) {
692 translation_helper_.ReportError("Expected boolean expression."); 692 translation_helper_.ReportError("Expected boolean expression.");
693 } 693 }
694 } 694 }
695 695
696 bool EvaluateBooleanExpressionHere(); 696 bool EvaluateBooleanExpressionHere();
697 697
698 bool GetCachedConstant(intptr_t kernel_offset, Instance* value); 698 bool GetCachedConstant(intptr_t kernel_offset, Instance* value);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 void SetOffset(intptr_t offset); 799 void SetOffset(intptr_t offset);
800 void SkipBytes(intptr_t skip); 800 void SkipBytes(intptr_t skip);
801 bool ReadBool(); 801 bool ReadBool();
802 uint8_t ReadByte(); 802 uint8_t ReadByte();
803 uint32_t ReadUInt(); 803 uint32_t ReadUInt();
804 uint32_t PeekUInt(); 804 uint32_t PeekUInt();
805 intptr_t ReadListLength(); 805 intptr_t ReadListLength();
806 StringIndex ReadStringReference(); 806 StringIndex ReadStringReference();
807 NameIndex ReadCanonicalNameReference(); 807 NameIndex ReadCanonicalNameReference();
808 StringIndex ReadNameAsStringIndex(); 808 StringIndex ReadNameAsStringIndex();
809 const dart::String& ReadNameAsMethodName(); 809 const String& ReadNameAsMethodName();
810 const dart::String& ReadNameAsGetterName(); 810 const String& ReadNameAsGetterName();
811 const dart::String& ReadNameAsSetterName(); 811 const String& ReadNameAsSetterName();
812 const dart::String& ReadNameAsFieldName(); 812 const String& ReadNameAsFieldName();
813 void SkipStringReference(); 813 void SkipStringReference();
814 void SkipCanonicalNameReference(); 814 void SkipCanonicalNameReference();
815 void SkipDartType(); 815 void SkipDartType();
816 void SkipOptionalDartType(); 816 void SkipOptionalDartType();
817 void SkipInterfaceType(bool simple); 817 void SkipInterfaceType(bool simple);
818 void SkipFunctionType(bool simple); 818 void SkipFunctionType(bool simple);
819 void SkipListOfExpressions(); 819 void SkipListOfExpressions();
820 void SkipListOfDartTypes(); 820 void SkipListOfDartTypes();
821 void SkipListOfStrings(); 821 void SkipListOfStrings();
822 void SkipListOfVariableDeclarations(); 822 void SkipListOfVariableDeclarations();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 ParsedFunction* parsed_function(); 859 ParsedFunction* parsed_function();
860 TryFinallyBlock* try_finally_block(); 860 TryFinallyBlock* try_finally_block();
861 SwitchBlock* switch_block(); 861 SwitchBlock* switch_block();
862 BreakableBlock* breakable_block(); 862 BreakableBlock* breakable_block();
863 GrowableArray<YieldContinuation>& yield_continuations(); 863 GrowableArray<YieldContinuation>& yield_continuations();
864 Value* stack(); 864 Value* stack();
865 void Push(Definition* definition); 865 void Push(Definition* definition);
866 Value* Pop(); 866 Value* Pop();
867 867
868 Tag PeekArgumentsFirstPositionalTag(); 868 Tag PeekArgumentsFirstPositionalTag();
869 const TypeArguments& PeekArgumentsInstantiatedType(const dart::Class& klass); 869 const TypeArguments& PeekArgumentsInstantiatedType(const Class& klass);
870 intptr_t PeekArgumentsCount(); 870 intptr_t PeekArgumentsCount();
871 intptr_t PeekArgumentsTypeCount(); 871 intptr_t PeekArgumentsTypeCount();
872 void SkipArgumentsBeforeActualArguments(); 872 void SkipArgumentsBeforeActualArguments();
873 873
874 LocalVariable* LookupVariable(intptr_t kernel_offset); 874 LocalVariable* LookupVariable(intptr_t kernel_offset);
875 LocalVariable* MakeTemporary(); 875 LocalVariable* MakeTemporary();
876 Token::Kind MethodKind(const dart::String& name); 876 Token::Kind MethodKind(const String& name);
877 dart::RawFunction* LookupMethodByMember(NameIndex target, 877 RawFunction* LookupMethodByMember(NameIndex target,
878 const dart::String& method_name); 878 const String& method_name);
879 879
880 bool NeedsDebugStepCheck(const Function& function, TokenPosition position); 880 bool NeedsDebugStepCheck(const Function& function, TokenPosition position);
881 bool NeedsDebugStepCheck(Value* value, TokenPosition position); 881 bool NeedsDebugStepCheck(Value* value, TokenPosition position);
882 882
883 void InlineBailout(const char* reason); 883 void InlineBailout(const char* reason);
884 Fragment DebugStepCheck(TokenPosition position); 884 Fragment DebugStepCheck(TokenPosition position);
885 Fragment LoadLocal(LocalVariable* variable); 885 Fragment LoadLocal(LocalVariable* variable);
886 Fragment Return(TokenPosition position); 886 Fragment Return(TokenPosition position);
887 Fragment PushArgument(); 887 Fragment PushArgument();
888 Fragment EvaluateAssertion(); 888 Fragment EvaluateAssertion();
889 Fragment RethrowException(TokenPosition position, int catch_try_index); 889 Fragment RethrowException(TokenPosition position, int catch_try_index);
890 Fragment ThrowNoSuchMethodError(); 890 Fragment ThrowNoSuchMethodError();
891 Fragment Constant(const Object& value); 891 Fragment Constant(const Object& value);
892 Fragment IntConstant(int64_t value); 892 Fragment IntConstant(int64_t value);
893 Fragment LoadStaticField(); 893 Fragment LoadStaticField();
894 Fragment StaticCall(TokenPosition position, 894 Fragment StaticCall(TokenPosition position,
895 const Function& target, 895 const Function& target,
896 intptr_t argument_count); 896 intptr_t argument_count);
897 Fragment StaticCall(TokenPosition position, 897 Fragment StaticCall(TokenPosition position,
898 const Function& target, 898 const Function& target,
899 intptr_t argument_count, 899 intptr_t argument_count,
900 const Array& argument_names, 900 const Array& argument_names,
901 intptr_t type_args_len = 0); 901 intptr_t type_args_len = 0);
902 Fragment InstanceCall(TokenPosition position, 902 Fragment InstanceCall(TokenPosition position,
903 const dart::String& name, 903 const String& name,
904 Token::Kind kind, 904 Token::Kind kind,
905 intptr_t argument_count, 905 intptr_t argument_count,
906 intptr_t checked_argument_count = 1); 906 intptr_t checked_argument_count = 1);
907 Fragment InstanceCall(TokenPosition position, 907 Fragment InstanceCall(TokenPosition position,
908 const dart::String& name, 908 const String& name,
909 Token::Kind kind, 909 Token::Kind kind,
910 intptr_t type_args_len, 910 intptr_t type_args_len,
911 intptr_t argument_count, 911 intptr_t argument_count,
912 const Array& argument_names, 912 const Array& argument_names,
913 intptr_t checked_argument_count); 913 intptr_t checked_argument_count);
914 Fragment ThrowException(TokenPosition position); 914 Fragment ThrowException(TokenPosition position);
915 Fragment BooleanNegate(); 915 Fragment BooleanNegate();
916 Fragment TranslateInstantiatedTypeArguments( 916 Fragment TranslateInstantiatedTypeArguments(
917 const TypeArguments& type_arguments); 917 const TypeArguments& type_arguments);
918 Fragment StrictCompare(Token::Kind kind, bool number_check = false); 918 Fragment StrictCompare(Token::Kind kind, bool number_check = false);
919 Fragment AllocateObject(TokenPosition position, 919 Fragment AllocateObject(TokenPosition position,
920 const dart::Class& klass, 920 const Class& klass,
921 intptr_t argument_count); 921 intptr_t argument_count);
922 Fragment AllocateObject(const dart::Class& klass, 922 Fragment AllocateObject(const Class& klass, const Function& closure_function);
923 const Function& closure_function);
924 Fragment AllocateContext(intptr_t size); 923 Fragment AllocateContext(intptr_t size);
925 Fragment LoadField(intptr_t offset); 924 Fragment LoadField(intptr_t offset);
926 Fragment StoreLocal(TokenPosition position, LocalVariable* variable); 925 Fragment StoreLocal(TokenPosition position, LocalVariable* variable);
927 Fragment StoreStaticField(TokenPosition position, const dart::Field& field); 926 Fragment StoreStaticField(TokenPosition position, const Field& field);
928 Fragment StoreInstanceField(TokenPosition position, intptr_t offset); 927 Fragment StoreInstanceField(TokenPosition position, intptr_t offset);
929 Fragment StringInterpolate(TokenPosition position); 928 Fragment StringInterpolate(TokenPosition position);
930 Fragment StringInterpolateSingle(TokenPosition position); 929 Fragment StringInterpolateSingle(TokenPosition position);
931 Fragment ThrowTypeError(); 930 Fragment ThrowTypeError();
932 Fragment LoadInstantiatorTypeArguments(); 931 Fragment LoadInstantiatorTypeArguments();
933 Fragment LoadFunctionTypeArguments(); 932 Fragment LoadFunctionTypeArguments();
934 Fragment InstantiateType(const AbstractType& type); 933 Fragment InstantiateType(const AbstractType& type);
935 Fragment CreateArray(); 934 Fragment CreateArray();
936 Fragment StoreIndexed(intptr_t class_id); 935 Fragment StoreIndexed(intptr_t class_id);
937 Fragment CheckStackOverflow(); 936 Fragment CheckStackOverflow();
(...skipping 13 matching lines...) Expand all
951 intptr_t handler_index, 950 intptr_t handler_index,
952 bool needs_stacktrace); 951 bool needs_stacktrace);
953 Fragment TryCatch(int try_handler_index); 952 Fragment TryCatch(int try_handler_index);
954 Fragment Drop(); 953 Fragment Drop();
955 Fragment NullConstant(); 954 Fragment NullConstant();
956 JoinEntryInstr* BuildJoinEntry(); 955 JoinEntryInstr* BuildJoinEntry();
957 JoinEntryInstr* BuildJoinEntry(intptr_t try_index); 956 JoinEntryInstr* BuildJoinEntry(intptr_t try_index);
958 Fragment Goto(JoinEntryInstr* destination); 957 Fragment Goto(JoinEntryInstr* destination);
959 Fragment BuildImplicitClosureCreation(const Function& target); 958 Fragment BuildImplicitClosureCreation(const Function& target);
960 Fragment CheckBooleanInCheckedMode(); 959 Fragment CheckBooleanInCheckedMode();
961 Fragment CheckAssignableInCheckedMode(const dart::AbstractType& dst_type, 960 Fragment CheckAssignableInCheckedMode(const AbstractType& dst_type,
962 const dart::String& dst_name); 961 const String& dst_name);
963 Fragment CheckVariableTypeInCheckedMode(intptr_t variable_kernel_position); 962 Fragment CheckVariableTypeInCheckedMode(intptr_t variable_kernel_position);
964 Fragment CheckVariableTypeInCheckedMode(const AbstractType& dst_type, 963 Fragment CheckVariableTypeInCheckedMode(const AbstractType& dst_type,
965 const dart::String& name_symbol); 964 const String& name_symbol);
966 Fragment EnterScope(intptr_t kernel_offset, bool* new_context = NULL); 965 Fragment EnterScope(intptr_t kernel_offset, bool* new_context = NULL);
967 Fragment ExitScope(intptr_t kernel_offset); 966 Fragment ExitScope(intptr_t kernel_offset);
968 967
969 Fragment TranslateCondition(bool* negate); 968 Fragment TranslateCondition(bool* negate);
970 const TypeArguments& BuildTypeArguments(); 969 const TypeArguments& BuildTypeArguments();
971 Fragment BuildArguments(Array* argument_names, 970 Fragment BuildArguments(Array* argument_names,
972 intptr_t* argument_count, 971 intptr_t* argument_count,
973 bool skip_push_arguments = false, 972 bool skip_push_arguments = false,
974 bool do_drop = false); 973 bool do_drop = false);
975 Fragment BuildArgumentsFromActualArguments(Array* argument_names, 974 Fragment BuildArgumentsFromActualArguments(Array* argument_names,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 Fragment BuildContinueSwitchStatement(); 1033 Fragment BuildContinueSwitchStatement();
1035 Fragment BuildIfStatement(); 1034 Fragment BuildIfStatement();
1036 Fragment BuildReturnStatement(); 1035 Fragment BuildReturnStatement();
1037 Fragment BuildTryCatch(); 1036 Fragment BuildTryCatch();
1038 Fragment BuildTryFinally(); 1037 Fragment BuildTryFinally();
1039 Fragment BuildYieldStatement(); 1038 Fragment BuildYieldStatement();
1040 Fragment BuildVariableDeclaration(); 1039 Fragment BuildVariableDeclaration();
1041 Fragment BuildFunctionDeclaration(); 1040 Fragment BuildFunctionDeclaration();
1042 Fragment BuildFunctionNode(TokenPosition parent_position, 1041 Fragment BuildFunctionNode(TokenPosition parent_position,
1043 StringIndex name_index); 1042 StringIndex name_index);
1044 void SetupFunctionParameters(const dart::Class& klass, 1043 void SetupFunctionParameters(const Class& klass,
1045 const dart::Function& function, 1044 const Function& function,
1046 bool is_method, 1045 bool is_method,
1047 bool is_closure, 1046 bool is_closure,
1048 FunctionNodeHelper* function_node_helper); 1047 FunctionNodeHelper* function_node_helper);
1049 1048
1050 FlowGraphBuilder* flow_graph_builder_; 1049 FlowGraphBuilder* flow_graph_builder_;
1051 TranslationHelper& translation_helper_; 1050 TranslationHelper& translation_helper_;
1052 Zone* zone_; 1051 Zone* zone_;
1053 Reader* reader_; 1052 Reader* reader_;
1054 StreamingConstantEvaluator constant_evaluator_; 1053 StreamingConstantEvaluator constant_evaluator_;
1055 StreamingDartTypeTranslator type_translator_; 1054 StreamingDartTypeTranslator type_translator_;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 const uint8_t* saved_raw_buffer_; 1121 const uint8_t* saved_raw_buffer_;
1123 const TypedData* saved_typed_data_; 1122 const TypedData* saved_typed_data_;
1124 intptr_t saved_offset_; 1123 intptr_t saved_offset_;
1125 }; 1124 };
1126 1125
1127 } // namespace kernel 1126 } // namespace kernel
1128 } // namespace dart 1127 } // namespace dart
1129 1128
1130 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1129 #endif // !defined(DART_PRECOMPILED_RUNTIME)
1131 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ 1130 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
OLDNEW
« no previous file with comments | « runtime/vm/kernel.h ('k') | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698