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

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

Issue 2894953002: Support inlining of calls where type arguments are passed to generic functions. (Closed)
Patch Set: address review comments Created 3 years, 5 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 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 M(PushArgument) \ 374 M(PushArgument) \
375 M(Return) \ 375 M(Return) \
376 M(Throw) \ 376 M(Throw) \
377 M(ReThrow) \ 377 M(ReThrow) \
378 M(Stop) \ 378 M(Stop) \
379 M(Goto) \ 379 M(Goto) \
380 M(IndirectGoto) \ 380 M(IndirectGoto) \
381 M(Branch) \ 381 M(Branch) \
382 M(AssertAssignable) \ 382 M(AssertAssignable) \
383 M(AssertBoolean) \ 383 M(AssertBoolean) \
384 M(CurrentContext) \ 384 M(SpecialParameter) \
385 M(ClosureCall) \ 385 M(ClosureCall) \
386 M(InstanceCall) \ 386 M(InstanceCall) \
387 M(PolymorphicInstanceCall) \ 387 M(PolymorphicInstanceCall) \
388 M(StaticCall) \ 388 M(StaticCall) \
389 M(LoadLocal) \ 389 M(LoadLocal) \
390 M(DropTemps) \ 390 M(DropTemps) \
391 M(StoreLocal) \ 391 M(StoreLocal) \
392 M(StrictCompare) \ 392 M(StrictCompare) \
393 M(EqualityCompare) \ 393 M(EqualityCompare) \
394 M(RelationalOp) \ 394 M(RelationalOp) \
(...skipping 2376 matching lines...) Expand 10 before | Expand all | Expand 10 after
2771 2771
2772 PRINT_OPERANDS_TO_SUPPORT 2772 PRINT_OPERANDS_TO_SUPPORT
2773 2773
2774 private: 2774 private:
2775 const TokenPosition token_pos_; 2775 const TokenPosition token_pos_;
2776 2776
2777 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); 2777 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr);
2778 }; 2778 };
2779 2779
2780 2780
2781 // Denotes the current context, normally held in a register. This is 2781 // Denotes a special parameter, currently either the context of a closure
2782 // a computation, not a value, because it's mutable. 2782 // or the type arguments of a generic function.
2783 class CurrentContextInstr : public TemplateDefinition<0, NoThrow> { 2783 class SpecialParameterInstr : public TemplateDefinition<0, NoThrow> {
2784 public: 2784 public:
2785 explicit CurrentContextInstr(intptr_t deopt_id) 2785 enum SpecialParameterKind { kContext, kTypeArgs };
2786 : TemplateDefinition(deopt_id) {} 2786 SpecialParameterInstr(SpecialParameterKind kind, intptr_t deopt_id)
2787 : TemplateDefinition(deopt_id), kind_(kind) {}
2787 2788
2788 DECLARE_INSTRUCTION(CurrentContext) 2789 DECLARE_INSTRUCTION(SpecialParameter)
2789 virtual CompileType ComputeType() const; 2790 virtual CompileType ComputeType() const;
2790 2791
2791 virtual bool ComputeCanDeoptimize() const { return false; } 2792 virtual bool ComputeCanDeoptimize() const { return false; }
2792 2793
2793 virtual EffectSet Effects() const { return EffectSet::None(); } 2794 virtual EffectSet Effects() const { return EffectSet::None(); }
2794 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2795 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2795 virtual bool AttributesEqual(Instruction* other) const { return true; } 2796 virtual bool AttributesEqual(Instruction* other) const {
2797 return kind() == other->AsSpecialParameter()->kind();
2798 }
2799 SpecialParameterKind kind() const { return kind_; }
2796 2800
2797 private: 2801 private:
2798 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); 2802 const SpecialParameterKind kind_;
2803 DISALLOW_COPY_AND_ASSIGN(SpecialParameterInstr);
2799 }; 2804 };
2800 2805
2801 2806
2802 struct ArgumentsInfo { 2807 struct ArgumentsInfo {
2803 ArgumentsInfo(intptr_t type_args_len, 2808 ArgumentsInfo(intptr_t type_args_len,
2804 intptr_t pushed_argc, 2809 intptr_t pushed_argc,
2805 const Array& argument_names) 2810 const Array& argument_names)
2806 : type_args_len(type_args_len), 2811 : type_args_len(type_args_len),
2807 pushed_argc(pushed_argc), 2812 pushed_argc(pushed_argc),
2808 argument_names(argument_names) {} 2813 argument_names(argument_names) {}
(...skipping 5447 matching lines...) Expand 10 before | Expand all | Expand 10 after
8256 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8261 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8257 UNIMPLEMENTED(); \ 8262 UNIMPLEMENTED(); \
8258 return NULL; \ 8263 return NULL; \
8259 } \ 8264 } \
8260 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8265 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8261 8266
8262 8267
8263 } // namespace dart 8268 } // namespace dart
8264 8269
8265 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 8270 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698