OLD | NEW |
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 #ifndef RUNTIME_VM_KERNEL_TO_IL_H_ | 5 #ifndef RUNTIME_VM_KERNEL_TO_IL_H_ |
6 #define RUNTIME_VM_KERNEL_TO_IL_H_ | 6 #define RUNTIME_VM_KERNEL_TO_IL_H_ |
7 | 7 |
8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
9 | 9 |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
11 #include "vm/hash_map.h" | 11 #include "vm/hash_map.h" |
12 | 12 |
13 #include "vm/flow_graph.h" | 13 #include "vm/flow_graph.h" |
14 #include "vm/flow_graph_builder.h" | 14 #include "vm/flow_graph_builder.h" |
15 #include "vm/intermediate_language.h" | 15 #include "vm/intermediate_language.h" |
16 #include "vm/kernel.h" | |
17 | 16 |
18 namespace dart { | 17 namespace dart { |
19 namespace kernel { | 18 namespace kernel { |
20 | 19 |
21 class StreamingFlowGraphBuilder; | 20 class StreamingFlowGraphBuilder; |
22 | 21 |
23 class KernelConstMapKeyEqualsTraits { | 22 class KernelConstMapKeyEqualsTraits { |
24 public: | 23 public: |
25 static const char* Name() { return "KernelConstMapKeyEqualsTraits"; } | 24 static const char* Name() { return "KernelConstMapKeyEqualsTraits"; } |
26 static bool ReportStats() { return false; } | 25 static bool ReportStats() { return false; } |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 543 |
545 TranslationHelper& translation_helper_; | 544 TranslationHelper& translation_helper_; |
546 ActiveClass* active_class_; | 545 ActiveClass* active_class_; |
547 TypeParameterScope* type_parameter_scope_; | 546 TypeParameterScope* type_parameter_scope_; |
548 Zone* zone_; | 547 Zone* zone_; |
549 AbstractType& result_; | 548 AbstractType& result_; |
550 bool finalize_; | 549 bool finalize_; |
551 }; | 550 }; |
552 | 551 |
553 | 552 |
554 // There are several cases when we are compiling constant expressions: | |
555 // | |
556 // * constant field initializers: | |
557 // const FieldName = <expr>; | |
558 // | |
559 // * constant expressions: | |
560 // const [<expr>, ...] | |
561 // const {<expr> : <expr>, ...} | |
562 // const Constructor(<expr>, ...) | |
563 // | |
564 // * constant default parameters: | |
565 // f(a, [b = <expr>]) | |
566 // f(a, {b: <expr>}) | |
567 // | |
568 // * constant values to compare in a [SwitchCase] | |
569 // case <expr>: | |
570 // | |
571 // In all cases `<expr>` must be recursively evaluated and canonicalized at | |
572 // compile-time. | |
573 class ConstantEvaluator : public ExpressionVisitor { | |
574 public: | |
575 ConstantEvaluator(FlowGraphBuilder* builder, | |
576 Zone* zone, | |
577 TranslationHelper* h, | |
578 DartTypeTranslator* type_translator); | |
579 virtual ~ConstantEvaluator() {} | |
580 | |
581 Instance& EvaluateExpression(Expression* node); | |
582 Object& EvaluateExpressionSafe(Expression* node); | |
583 Instance& EvaluateConstructorInvocation(ConstructorInvocation* node); | |
584 Instance& EvaluateListLiteral(ListLiteral* node); | |
585 Instance& EvaluateMapLiteral(MapLiteral* node); | |
586 | |
587 virtual void VisitDefaultExpression(Expression* node) { UNREACHABLE(); } | |
588 | |
589 virtual void VisitBigintLiteral(BigintLiteral* node); | |
590 virtual void VisitBoolLiteral(BoolLiteral* node); | |
591 virtual void VisitDoubleLiteral(DoubleLiteral* node); | |
592 virtual void VisitIntLiteral(IntLiteral* node); | |
593 virtual void VisitNullLiteral(NullLiteral* node); | |
594 virtual void VisitStringLiteral(StringLiteral* node); | |
595 virtual void VisitSymbolLiteral(SymbolLiteral* node); | |
596 virtual void VisitTypeLiteral(TypeLiteral* node); | |
597 | |
598 virtual void VisitListLiteral(ListLiteral* node); | |
599 virtual void VisitMapLiteral(MapLiteral* node); | |
600 | |
601 virtual void VisitConstructorInvocation(ConstructorInvocation* node); | |
602 virtual void VisitMethodInvocation(MethodInvocation* node); | |
603 virtual void VisitStaticGet(StaticGet* node); | |
604 virtual void VisitVariableGet(VariableGet* node); | |
605 virtual void VisitLet(Let* node); | |
606 virtual void VisitStaticInvocation(StaticInvocation* node); | |
607 virtual void VisitStringConcatenation(StringConcatenation* node); | |
608 virtual void VisitConditionalExpression(ConditionalExpression* node); | |
609 virtual void VisitLogicalExpression(LogicalExpression* node); | |
610 virtual void VisitNot(Not* node); | |
611 virtual void VisitPropertyGet(PropertyGet* node); | |
612 | |
613 private: | |
614 // This will translate type arguments form [kernel_arguments]. If no type | |
615 // arguments are passed and the [target] is a factory then the null type | |
616 // argument array will be returned. | |
617 // | |
618 // If none of these cases apply, NULL will be returned. | |
619 const TypeArguments* TranslateTypeArguments(const Function& target, | |
620 dart::Class* target_klass, | |
621 Arguments* kernel_arguments); | |
622 | |
623 const Object& RunFunction(const Function& function, | |
624 Arguments* arguments, | |
625 const Instance* receiver = NULL, | |
626 const TypeArguments* type_args = NULL); | |
627 | |
628 const Object& RunFunction(const Function& function, | |
629 const Array& arguments, | |
630 const Array& names); | |
631 | |
632 RawObject* EvaluateConstConstructorCall(const dart::Class& type_class, | |
633 const TypeArguments& type_arguments, | |
634 const Function& constructor, | |
635 const Object& argument); | |
636 | |
637 void AssertBoolInCheckedMode() { | |
638 if (isolate_->type_checks() && !result_.IsBool()) { | |
639 translation_helper_.ReportError("Expected boolean expression."); | |
640 } | |
641 } | |
642 | |
643 bool EvaluateBooleanExpression(Expression* expression) { | |
644 EvaluateExpression(expression); | |
645 AssertBoolInCheckedMode(); | |
646 return result_.raw() == Bool::True().raw(); | |
647 } | |
648 | |
649 bool GetCachedConstant(TreeNode* node, Instance* value); | |
650 void CacheConstantValue(TreeNode* node, const Instance& value); | |
651 | |
652 FlowGraphBuilder* builder_; | |
653 Isolate* isolate_; | |
654 Zone* zone_; | |
655 TranslationHelper& translation_helper_; | |
656 DartTypeTranslator& type_translator_; | |
657 | |
658 Script& script_; | |
659 Instance& result_; | |
660 }; | |
661 | |
662 | |
663 struct FunctionScope { | 553 struct FunctionScope { |
664 intptr_t kernel_offset; | 554 intptr_t kernel_offset; |
665 LocalScope* scope; | 555 LocalScope* scope; |
666 }; | 556 }; |
667 | 557 |
668 | 558 |
669 class ScopeBuildingResult : public ZoneAllocated { | 559 class ScopeBuildingResult : public ZoneAllocated { |
670 public: | 560 public: |
671 ScopeBuildingResult() | 561 ScopeBuildingResult() |
672 : this_variable(NULL), | 562 : this_variable(NULL), |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 Instruction* entry; | 611 Instruction* entry; |
722 intptr_t try_index; | 612 intptr_t try_index; |
723 | 613 |
724 YieldContinuation(Instruction* entry, intptr_t try_index) | 614 YieldContinuation(Instruction* entry, intptr_t try_index) |
725 : entry(entry), try_index(try_index) {} | 615 : entry(entry), try_index(try_index) {} |
726 | 616 |
727 YieldContinuation() | 617 YieldContinuation() |
728 : entry(NULL), try_index(CatchClauseNode::kInvalidTryIndex) {} | 618 : entry(NULL), try_index(CatchClauseNode::kInvalidTryIndex) {} |
729 }; | 619 }; |
730 | 620 |
731 class FlowGraphBuilder : public ExpressionVisitor, public StatementVisitor { | 621 class FlowGraphBuilder { |
732 public: | 622 public: |
733 FlowGraphBuilder(TreeNode* node, | 623 FlowGraphBuilder(intptr_t kernel_offset, |
734 ParsedFunction* parsed_function, | 624 ParsedFunction* parsed_function, |
735 const ZoneGrowableArray<const ICData*>& ic_data_array, | 625 const ZoneGrowableArray<const ICData*>& ic_data_array, |
736 ZoneGrowableArray<intptr_t>* context_level_array, | 626 ZoneGrowableArray<intptr_t>* context_level_array, |
737 InlineExitCollector* exit_collector, | 627 InlineExitCollector* exit_collector, |
738 intptr_t osr_id, | 628 intptr_t osr_id, |
739 intptr_t first_block_id = 1); | 629 intptr_t first_block_id = 1); |
740 virtual ~FlowGraphBuilder(); | 630 virtual ~FlowGraphBuilder(); |
741 | 631 |
742 FlowGraph* BuildGraph(); | 632 FlowGraph* BuildGraph(); |
743 | 633 |
744 virtual void VisitDefaultExpression(Expression* node) { UNREACHABLE(); } | |
745 virtual void VisitDefaultStatement(Statement* node) { UNREACHABLE(); } | |
746 | |
747 virtual void VisitInvalidExpression(InvalidExpression* node); | |
748 virtual void VisitNullLiteral(NullLiteral* node); | |
749 virtual void VisitBoolLiteral(BoolLiteral* node); | |
750 virtual void VisitIntLiteral(IntLiteral* node); | |
751 virtual void VisitBigintLiteral(BigintLiteral* node); | |
752 virtual void VisitDoubleLiteral(DoubleLiteral* node); | |
753 virtual void VisitStringLiteral(StringLiteral* node); | |
754 virtual void VisitSymbolLiteral(SymbolLiteral* node); | |
755 virtual void VisitTypeLiteral(TypeLiteral* node); | |
756 virtual void VisitVariableGet(VariableGet* node); | |
757 virtual void VisitVariableSet(VariableSet* node); | |
758 virtual void VisitStaticGet(StaticGet* node); | |
759 virtual void VisitStaticSet(StaticSet* node); | |
760 virtual void VisitPropertyGet(PropertyGet* node); | |
761 virtual void VisitPropertySet(PropertySet* node); | |
762 virtual void VisitDirectPropertyGet(DirectPropertyGet* node); | |
763 virtual void VisitDirectPropertySet(DirectPropertySet* node); | |
764 virtual void VisitStaticInvocation(StaticInvocation* node); | |
765 virtual void VisitMethodInvocation(MethodInvocation* node); | |
766 virtual void VisitDirectMethodInvocation(DirectMethodInvocation* node); | |
767 virtual void VisitConstructorInvocation(ConstructorInvocation* node); | |
768 virtual void VisitIsExpression(IsExpression* node); | |
769 virtual void VisitAsExpression(AsExpression* node); | |
770 virtual void VisitConditionalExpression(ConditionalExpression* node); | |
771 virtual void VisitLogicalExpression(LogicalExpression* node); | |
772 virtual void VisitNot(Not* node); | |
773 virtual void VisitThisExpression(ThisExpression* node); | |
774 virtual void VisitStringConcatenation(StringConcatenation* node); | |
775 virtual void VisitListLiteral(ListLiteral* node); | |
776 virtual void VisitMapLiteral(MapLiteral* node); | |
777 virtual void VisitFunctionExpression(FunctionExpression* node); | |
778 virtual void VisitLet(Let* node); | |
779 virtual void VisitThrow(Throw* node); | |
780 virtual void VisitRethrow(Rethrow* node); | |
781 | |
782 virtual void VisitInvalidStatement(InvalidStatement* node); | |
783 virtual void VisitEmptyStatement(EmptyStatement* node); | |
784 virtual void VisitBlock(Block* node); | |
785 virtual void VisitReturnStatement(ReturnStatement* node); | |
786 virtual void VisitExpressionStatement(ExpressionStatement* node); | |
787 virtual void VisitVariableDeclaration(VariableDeclaration* node); | |
788 virtual void VisitFunctionDeclaration(FunctionDeclaration* node); | |
789 virtual void VisitIfStatement(IfStatement* node); | |
790 virtual void VisitWhileStatement(WhileStatement* node); | |
791 virtual void VisitDoStatement(DoStatement* node); | |
792 virtual void VisitForStatement(ForStatement* node); | |
793 virtual void VisitForInStatement(ForInStatement* node); | |
794 virtual void VisitLabeledStatement(LabeledStatement* node); | |
795 virtual void VisitBreakStatement(BreakStatement* node); | |
796 virtual void VisitSwitchStatement(SwitchStatement* node); | |
797 virtual void VisitContinueSwitchStatement(ContinueSwitchStatement* node); | |
798 virtual void VisitAssertStatement(AssertStatement* node); | |
799 virtual void VisitTryFinally(TryFinally* node); | |
800 virtual void VisitTryCatch(TryCatch* node); | |
801 virtual void VisitYieldStatement(YieldStatement* node); | |
802 | |
803 private: | 634 private: |
804 FlowGraph* BuildGraphOfFunction(FunctionNode* node, | |
805 Constructor* constructor = NULL); | |
806 FlowGraph* BuildGraphOfFieldAccessor(Field* node, | |
807 LocalVariable* setter_value); | |
808 FlowGraph* BuildGraphOfStaticFieldInitializer(Field* node); | |
809 FlowGraph* BuildGraphOfMethodExtractor(const Function& method); | 635 FlowGraph* BuildGraphOfMethodExtractor(const Function& method); |
810 FlowGraph* BuildGraphOfImplicitClosureFunction(FunctionNode* kernel_function, | |
811 const Function& function); | |
812 FlowGraph* BuildGraphOfNoSuchMethodDispatcher(const Function& function); | 636 FlowGraph* BuildGraphOfNoSuchMethodDispatcher(const Function& function); |
813 FlowGraph* BuildGraphOfInvokeFieldDispatcher(const Function& function); | 637 FlowGraph* BuildGraphOfInvokeFieldDispatcher(const Function& function); |
814 | 638 |
815 Fragment NativeFunctionBody(FunctionNode* kernel_function, | 639 Fragment NativeFunctionBody(intptr_t first_positional_offset, |
816 const Function& function); | 640 const Function& function); |
817 | 641 |
818 void SetupDefaultParameterValues(FunctionNode* function); | |
819 | |
820 TargetEntryInstr* BuildTargetEntry(); | 642 TargetEntryInstr* BuildTargetEntry(); |
821 JoinEntryInstr* BuildJoinEntry(); | 643 JoinEntryInstr* BuildJoinEntry(); |
822 JoinEntryInstr* BuildJoinEntry(intptr_t try_index); | 644 JoinEntryInstr* BuildJoinEntry(intptr_t try_index); |
823 | 645 |
824 Fragment TranslateArguments(Arguments* node, Array* argument_names); | |
825 ArgumentArray GetArguments(int count); | 646 ArgumentArray GetArguments(int count); |
826 | 647 |
827 Fragment TranslateInitializers(Class* kernel_class, | |
828 List<Initializer>* initialiers); | |
829 Fragment TranslateFieldInitializer(NameIndex canonical_name, | |
830 Expression* init); | |
831 | |
832 Fragment TranslateStatement(Statement* statement); | |
833 Fragment TranslateCondition(Expression* expression, bool* negate); | |
834 Fragment TranslateExpression(Expression* expression); | |
835 | |
836 Fragment TranslateFinallyFinalizers(TryFinallyBlock* outer_finally, | 648 Fragment TranslateFinallyFinalizers(TryFinallyBlock* outer_finally, |
837 intptr_t target_context_depth); | 649 intptr_t target_context_depth); |
838 | 650 |
839 Fragment TranslateFunctionNode(FunctionNode* node, TreeNode* parent); | |
840 | |
841 Fragment EnterScope(TreeNode* node, bool* new_context = NULL); | |
842 Fragment EnterScope(intptr_t kernel_offset, bool* new_context = NULL); | 651 Fragment EnterScope(intptr_t kernel_offset, bool* new_context = NULL); |
843 Fragment ExitScope(TreeNode* node); | |
844 Fragment ExitScope(intptr_t kernel_offset); | 652 Fragment ExitScope(intptr_t kernel_offset); |
845 | 653 |
846 Fragment LoadContextAt(int depth); | 654 Fragment LoadContextAt(int depth); |
847 Fragment AdjustContextTo(int depth); | 655 Fragment AdjustContextTo(int depth); |
848 | 656 |
849 Fragment PushContext(int size); | 657 Fragment PushContext(int size); |
850 Fragment PopContext(); | 658 Fragment PopContext(); |
851 | 659 |
852 Fragment LoadInstantiatorTypeArguments(); | 660 Fragment LoadInstantiatorTypeArguments(); |
853 Fragment LoadFunctionTypeArguments(); | 661 Fragment LoadFunctionTypeArguments(); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 Fragment StringInterpolate(TokenPosition position); | 744 Fragment StringInterpolate(TokenPosition position); |
937 Fragment StringInterpolateSingle(TokenPosition position); | 745 Fragment StringInterpolateSingle(TokenPosition position); |
938 Fragment ThrowTypeError(); | 746 Fragment ThrowTypeError(); |
939 Fragment ThrowNoSuchMethodError(); | 747 Fragment ThrowNoSuchMethodError(); |
940 Fragment BuildImplicitClosureCreation(const Function& target); | 748 Fragment BuildImplicitClosureCreation(const Function& target); |
941 Fragment GuardFieldLength(const dart::Field& field, intptr_t deopt_id); | 749 Fragment GuardFieldLength(const dart::Field& field, intptr_t deopt_id); |
942 Fragment GuardFieldClass(const dart::Field& field, intptr_t deopt_id); | 750 Fragment GuardFieldClass(const dart::Field& field, intptr_t deopt_id); |
943 | 751 |
944 Fragment EvaluateAssertion(); | 752 Fragment EvaluateAssertion(); |
945 Fragment CheckReturnTypeInCheckedMode(); | 753 Fragment CheckReturnTypeInCheckedMode(); |
946 Fragment CheckVariableTypeInCheckedMode(VariableDeclaration* variable); | |
947 Fragment CheckVariableTypeInCheckedMode(const AbstractType& dst_type, | 754 Fragment CheckVariableTypeInCheckedMode(const AbstractType& dst_type, |
948 const dart::String& name_symbol); | 755 const dart::String& name_symbol); |
949 Fragment CheckBooleanInCheckedMode(); | 756 Fragment CheckBooleanInCheckedMode(); |
950 Fragment CheckAssignableInCheckedMode(const dart::AbstractType& dst_type, | 757 Fragment CheckAssignableInCheckedMode(const dart::AbstractType& dst_type, |
951 const dart::String& dst_name); | 758 const dart::String& dst_name); |
952 | 759 |
953 Fragment AssertBool(); | 760 Fragment AssertBool(); |
954 Fragment AssertAssignable(const dart::AbstractType& dst_type, | 761 Fragment AssertAssignable(const dart::AbstractType& dst_type, |
955 const dart::String& dst_name); | 762 const dart::String& dst_name); |
956 | 763 |
957 template <class Invocation> | |
958 bool RecognizeComparisonWithNull(Token::Kind token_kind, Invocation* node); | |
959 | |
960 bool NeedsDebugStepCheck(const Function& function, TokenPosition position); | 764 bool NeedsDebugStepCheck(const Function& function, TokenPosition position); |
961 bool NeedsDebugStepCheck(Value* value, TokenPosition position); | 765 bool NeedsDebugStepCheck(Value* value, TokenPosition position); |
962 Fragment DebugStepCheck(TokenPosition position); | 766 Fragment DebugStepCheck(TokenPosition position); |
963 | 767 |
964 dart::RawFunction* LookupMethodByMember(NameIndex target, | 768 dart::RawFunction* LookupMethodByMember(NameIndex target, |
965 const dart::String& method_name); | 769 const dart::String& method_name); |
966 | 770 |
967 LocalVariable* MakeTemporary(); | 771 LocalVariable* MakeTemporary(); |
968 LocalVariable* MakeNonTemporary(const dart::String& symbol); | 772 LocalVariable* MakeNonTemporary(const dart::String& symbol); |
969 | 773 |
970 intptr_t CurrentTryIndex(); | 774 intptr_t CurrentTryIndex(); |
971 intptr_t AllocateTryIndex() { return next_used_try_index_++; } | 775 intptr_t AllocateTryIndex() { return next_used_try_index_++; } |
972 | 776 |
973 void AddVariable(VariableDeclaration* declaration, LocalVariable* variable); | |
974 void AddParameter(VariableDeclaration* declaration, | |
975 LocalVariable* variable, | |
976 intptr_t pos); | |
977 dart::LocalVariable* LookupVariable(VariableDeclaration* var); | 777 dart::LocalVariable* LookupVariable(VariableDeclaration* var); |
978 dart::LocalVariable* LookupVariable(intptr_t kernel_offset); | 778 dart::LocalVariable* LookupVariable(intptr_t kernel_offset); |
979 | 779 |
980 void SetTempIndex(Definition* definition); | 780 void SetTempIndex(Definition* definition); |
981 | 781 |
982 void Push(Definition* definition); | 782 void Push(Definition* definition); |
983 Value* Pop(); | 783 Value* Pop(); |
984 Fragment Drop(); | 784 Fragment Drop(); |
985 | 785 |
986 bool IsInlining() { return exit_collector_ != NULL; } | 786 bool IsInlining() { return exit_collector_ != NULL; } |
987 | 787 |
988 Token::Kind MethodKind(const dart::String& name); | 788 Token::Kind MethodKind(const dart::String& name); |
989 | 789 |
990 void InlineBailout(const char* reason); | 790 void InlineBailout(const char* reason); |
991 | 791 |
992 TranslationHelper translation_helper_; | 792 TranslationHelper translation_helper_; |
993 Thread* thread_; | 793 Thread* thread_; |
994 Zone* zone_; | 794 Zone* zone_; |
995 | 795 |
996 // The node we are currently compiling (e.g. FunctionNode, Constructor, | 796 intptr_t kernel_offset_; |
997 // Field) | |
998 TreeNode* node_; | |
999 | 797 |
1000 ParsedFunction* parsed_function_; | 798 ParsedFunction* parsed_function_; |
1001 intptr_t osr_id_; | 799 intptr_t osr_id_; |
1002 const ZoneGrowableArray<const ICData*>& ic_data_array_; | 800 const ZoneGrowableArray<const ICData*>& ic_data_array_; |
1003 // Contains (deopt_id, context_level) pairs. | 801 // Contains (deopt_id, context_level) pairs. |
1004 ZoneGrowableArray<intptr_t>* context_level_array_; | 802 ZoneGrowableArray<intptr_t>* context_level_array_; |
1005 InlineExitCollector* exit_collector_; | 803 InlineExitCollector* exit_collector_; |
1006 | 804 |
1007 intptr_t next_block_id_; | 805 intptr_t next_block_id_; |
1008 intptr_t AllocateBlockId() { return next_block_id_++; } | 806 intptr_t AllocateBlockId() { return next_block_id_++; } |
1009 | 807 |
1010 intptr_t GetNextDeoptId() { | 808 intptr_t GetNextDeoptId() { |
1011 intptr_t deopt_id = thread_->GetNextDeoptId(); | 809 intptr_t deopt_id = thread_->GetNextDeoptId(); |
1012 if (context_level_array_ != NULL) { | 810 if (context_level_array_ != NULL) { |
1013 intptr_t level = context_depth_; | 811 intptr_t level = context_depth_; |
1014 context_level_array_->Add(deopt_id); | 812 context_level_array_->Add(deopt_id); |
1015 context_level_array_->Add(level); | 813 context_level_array_->Add(level); |
1016 } | 814 } |
1017 return deopt_id; | 815 return deopt_id; |
1018 } | 816 } |
1019 | 817 |
1020 intptr_t next_function_id_; | 818 intptr_t next_function_id_; |
1021 intptr_t AllocateFunctionId() { return next_function_id_++; } | 819 intptr_t AllocateFunctionId() { return next_function_id_++; } |
1022 | 820 |
1023 intptr_t context_depth_; | 821 intptr_t context_depth_; |
1024 intptr_t loop_depth_; | 822 intptr_t loop_depth_; |
1025 intptr_t try_depth_; | 823 intptr_t try_depth_; |
1026 intptr_t catch_depth_; | 824 intptr_t catch_depth_; |
1027 intptr_t for_in_depth_; | 825 intptr_t for_in_depth_; |
1028 Fragment fragment_; | |
1029 Value* stack_; | 826 Value* stack_; |
1030 intptr_t pending_argument_count_; | 827 intptr_t pending_argument_count_; |
1031 | 828 |
1032 GraphEntryInstr* graph_entry_; | 829 GraphEntryInstr* graph_entry_; |
1033 | 830 |
1034 ScopeBuildingResult* scopes_; | 831 ScopeBuildingResult* scopes_; |
1035 | 832 |
1036 GrowableArray<YieldContinuation> yield_continuations_; | 833 GrowableArray<YieldContinuation> yield_continuations_; |
1037 | 834 |
1038 LocalVariable* CurrentException() { | 835 LocalVariable* CurrentException() { |
(...skipping 23 matching lines...) Expand all Loading... |
1062 // [TryCatchBlock] class. | 859 // [TryCatchBlock] class. |
1063 TryCatchBlock* try_catch_block_; | 860 TryCatchBlock* try_catch_block_; |
1064 intptr_t next_used_try_index_; | 861 intptr_t next_used_try_index_; |
1065 | 862 |
1066 // A chained list of catch blocks. Chaining and lookup is done by the | 863 // A chained list of catch blocks. Chaining and lookup is done by the |
1067 // [CatchBlock] class. | 864 // [CatchBlock] class. |
1068 CatchBlock* catch_block_; | 865 CatchBlock* catch_block_; |
1069 | 866 |
1070 ActiveClass active_class_; | 867 ActiveClass active_class_; |
1071 DartTypeTranslator type_translator_; | 868 DartTypeTranslator type_translator_; |
1072 ConstantEvaluator constant_evaluator_; | |
1073 | 869 |
1074 StreamingFlowGraphBuilder* streaming_flow_graph_builder_; | 870 StreamingFlowGraphBuilder* streaming_flow_graph_builder_; |
1075 | 871 |
1076 friend class BreakableBlock; | 872 friend class BreakableBlock; |
1077 friend class CatchBlock; | 873 friend class CatchBlock; |
1078 friend class ConstantEvaluator; | 874 friend class ConstantEvaluator; |
1079 friend class DartTypeTranslator; | 875 friend class DartTypeTranslator; |
1080 friend class StreamingFlowGraphBuilder; | 876 friend class StreamingFlowGraphBuilder; |
1081 friend class ScopeBuilder; | 877 friend class ScopeBuilder; |
1082 friend class SwitchBlock; | 878 friend class SwitchBlock; |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 namespace kernel { | 1118 namespace kernel { |
1323 | 1119 |
1324 RawObject* EvaluateMetadata(const dart::Field& metadata_field); | 1120 RawObject* EvaluateMetadata(const dart::Field& metadata_field); |
1325 RawObject* BuildParameterDescriptor(const Function& function); | 1121 RawObject* BuildParameterDescriptor(const Function& function); |
1326 | 1122 |
1327 } // namespace kernel | 1123 } // namespace kernel |
1328 } // namespace dart | 1124 } // namespace dart |
1329 | 1125 |
1330 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1126 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
1331 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ | 1127 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ |
OLD | NEW |