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

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

Issue 10398046: Move code for accessing captured variables into the IL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 M(StoreInstanceField, StoreInstanceFieldComp) \ 46 M(StoreInstanceField, StoreInstanceFieldComp) \
47 M(LoadStaticField, LoadStaticFieldComp) \ 47 M(LoadStaticField, LoadStaticFieldComp) \
48 M(StoreStaticField, StoreStaticFieldComp) \ 48 M(StoreStaticField, StoreStaticFieldComp) \
49 M(BooleanNegate, BooleanNegateComp) \ 49 M(BooleanNegate, BooleanNegateComp) \
50 M(InstanceOf, InstanceOfComp) \ 50 M(InstanceOf, InstanceOfComp) \
51 M(CreateArray, CreateArrayComp) \ 51 M(CreateArray, CreateArrayComp) \
52 M(CreateClosure, CreateClosureComp) \ 52 M(CreateClosure, CreateClosureComp) \
53 M(AllocateObject, AllocateObjectComp) \ 53 M(AllocateObject, AllocateObjectComp) \
54 M(AllocateObjectWithBoundsCheck, AllocateObjectWithBoundsCheckComp) \ 54 M(AllocateObjectWithBoundsCheck, AllocateObjectWithBoundsCheckComp) \
55 M(NativeLoadField, NativeLoadFieldComp) \ 55 M(NativeLoadField, NativeLoadFieldComp) \
56 M(NativeStoreField, NativeStoreFieldComp) \
56 M(InstantiateTypeArguments, InstantiateTypeArgumentsComp) \ 57 M(InstantiateTypeArguments, InstantiateTypeArgumentsComp) \
57 M(ExtractConstructorTypeArguments, ExtractConstructorTypeArgumentsComp) \ 58 M(ExtractConstructorTypeArguments, ExtractConstructorTypeArgumentsComp) \
58 M(ExtractConstructorInstantiator, ExtractConstructorInstantiatorComp) \ 59 M(ExtractConstructorInstantiator, ExtractConstructorInstantiatorComp) \
59 M(AllocateContext, AllocateContextComp) \ 60 M(AllocateContext, AllocateContextComp) \
60 M(ChainContext, ChainContextComp) \ 61 M(ChainContext, ChainContextComp) \
61 M(CloneContext, CloneContextComp) \ 62 M(CloneContext, CloneContextComp) \
62 M(CatchEntry, CatchEntryComp) \ 63 M(CatchEntry, CatchEntryComp) \
63 64
64 65
65 #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName; 66 #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName;
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 ASSERT(value != NULL); 922 ASSERT(value != NULL);
922 inputs_[0] = value; 923 inputs_[0] = value;
923 } 924 }
924 925
925 DECLARE_COMPUTATION(NativeLoadField) 926 DECLARE_COMPUTATION(NativeLoadField)
926 927
927 Value* value() { return inputs_[0]; } 928 Value* value() { return inputs_[0]; }
928 intptr_t offset_in_bytes() const { return offset_in_bytes_; } 929 intptr_t offset_in_bytes() const { return offset_in_bytes_; }
929 930
930 private: 931 private:
931 intptr_t offset_in_bytes_; 932 const intptr_t offset_in_bytes_;
932 933
933 DISALLOW_COPY_AND_ASSIGN(NativeLoadFieldComp); 934 DISALLOW_COPY_AND_ASSIGN(NativeLoadFieldComp);
934 }; 935 };
935 936
936 937
938 class NativeStoreFieldComp : public TemplateComputation<2> {
939 public:
940 NativeStoreFieldComp(Value* dest, intptr_t offset_in_bytes, Value* value)
941 : offset_in_bytes_(offset_in_bytes) {
942 ASSERT(value != NULL);
943 inputs_[0] = dest;
944 inputs_[1] = value;
945 }
946
947 DECLARE_COMPUTATION(NativeStoreField)
948
949 Value* dest() { return inputs_[0]; }
950 Value* value() { return inputs_[1]; }
951 intptr_t offset_in_bytes() const { return offset_in_bytes_; }
952
953 private:
954 const intptr_t offset_in_bytes_;
955
956 DISALLOW_COPY_AND_ASSIGN(NativeStoreFieldComp);
957 };
958
959
937 class InstantiateTypeArgumentsComp : public TemplateComputation<1> { 960 class InstantiateTypeArgumentsComp : public TemplateComputation<1> {
938 public: 961 public:
939 InstantiateTypeArgumentsComp(intptr_t token_index, 962 InstantiateTypeArgumentsComp(intptr_t token_index,
940 intptr_t try_index, 963 intptr_t try_index,
941 const AbstractTypeArguments& type_arguments, 964 const AbstractTypeArguments& type_arguments,
942 Value* instantiator) 965 Value* instantiator)
943 : token_index_(token_index), 966 : token_index_(token_index),
944 try_index_(try_index), 967 try_index_(try_index),
945 type_arguments_(type_arguments) { 968 type_arguments_(type_arguments) {
946 ASSERT(instantiator != NULL); 969 ASSERT(instantiator != NULL);
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 const GrowableArray<BlockEntryInstr*>& block_order_; 1609 const GrowableArray<BlockEntryInstr*>& block_order_;
1587 1610
1588 private: 1611 private:
1589 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 1612 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
1590 }; 1613 };
1591 1614
1592 1615
1593 } // namespace dart 1616 } // namespace dart
1594 1617
1595 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 1618 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698