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

Side by Side Diff: src/hydrogen-instructions.h

Issue 10910161: Partial ia32 implementation of optimized try/catch (by Kevin Millikin) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed build. Created 8 years, 3 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 | « src/hydrogen.cc ('k') | src/ia32/assembler-ia32.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ 61 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
62 V(AbnormalExit) \ 62 V(AbnormalExit) \
63 V(AccessArgumentsAt) \ 63 V(AccessArgumentsAt) \
64 V(Add) \ 64 V(Add) \
65 V(AllocateObject) \ 65 V(AllocateObject) \
66 V(ApplyArguments) \ 66 V(ApplyArguments) \
67 V(ArgumentsElements) \ 67 V(ArgumentsElements) \
68 V(ArgumentsLength) \ 68 V(ArgumentsLength) \
69 V(ArgumentsObject) \ 69 V(ArgumentsObject) \
70 V(ArrayLiteral) \ 70 V(ArrayLiteral) \
71 V(BitNot) \
71 V(Bitwise) \ 72 V(Bitwise) \
72 V(BitNot) \
73 V(BlockEntry) \ 73 V(BlockEntry) \
74 V(BoundsCheck) \ 74 V(BoundsCheck) \
75 V(Branch) \ 75 V(Branch) \
76 V(CallConstantFunction) \ 76 V(CallConstantFunction) \
77 V(CallFunction) \ 77 V(CallFunction) \
78 V(CallGlobal) \ 78 V(CallGlobal) \
79 V(CallKeyed) \ 79 V(CallKeyed) \
80 V(CallKnownGlobal) \ 80 V(CallKnownGlobal) \
81 V(CallNamed) \ 81 V(CallNamed) \
82 V(CallNew) \ 82 V(CallNew) \
83 V(CallRuntime) \ 83 V(CallRuntime) \
84 V(CallStub) \ 84 V(CallStub) \
85 V(Change) \ 85 V(Change) \
86 V(CheckFunction) \ 86 V(CheckFunction) \
87 V(CheckInstanceType) \ 87 V(CheckInstanceType) \
88 V(CheckMaps) \ 88 V(CheckMaps) \
89 V(CheckNonSmi) \ 89 V(CheckNonSmi) \
90 V(CheckPrototypeMaps) \ 90 V(CheckPrototypeMaps) \
91 V(CheckSmi) \ 91 V(CheckSmi) \
92 V(ClampToUint8) \ 92 V(ClampToUint8) \
93 V(ClassOfTestAndBranch) \ 93 V(ClassOfTestAndBranch) \
94 V(CompareConstantEqAndBranch) \
95 V(CompareGeneric) \
94 V(CompareIDAndBranch) \ 96 V(CompareIDAndBranch) \
95 V(CompareGeneric) \ 97 V(CompareMap) \
96 V(CompareObjectEqAndBranch) \ 98 V(CompareObjectEqAndBranch) \
97 V(CompareMap) \
98 V(CompareConstantEqAndBranch) \
99 V(Constant) \ 99 V(Constant) \
100 V(Context) \ 100 V(Context) \
101 V(DeclareGlobals) \ 101 V(DeclareGlobals) \
102 V(DeleteProperty) \ 102 V(DeleteProperty) \
103 V(Deoptimize) \ 103 V(Deoptimize) \
104 V(Div) \ 104 V(Div) \
105 V(ElementsKind) \ 105 V(ElementsKind) \
106 V(EnterInlined) \ 106 V(EnterInlined) \
107 V(EnterTry) \
107 V(FastLiteral) \ 108 V(FastLiteral) \
108 V(FixedArrayBaseLength) \ 109 V(FixedArrayBaseLength) \
109 V(ForceRepresentation) \ 110 V(ForceRepresentation) \
110 V(FunctionLiteral) \ 111 V(FunctionLiteral) \
111 V(GetCachedArrayIndex) \ 112 V(GetCachedArrayIndex) \
112 V(GlobalObject) \ 113 V(GlobalObject) \
113 V(GlobalReceiver) \ 114 V(GlobalReceiver) \
114 V(Goto) \ 115 V(Goto) \
115 V(HasCachedArrayIndexAndBranch) \ 116 V(HasCachedArrayIndexAndBranch) \
116 V(HasInstanceTypeAndBranch) \ 117 V(HasInstanceTypeAndBranch) \
117 V(In) \ 118 V(In) \
118 V(InstanceOf) \ 119 V(InstanceOf) \
119 V(InstanceOfKnownGlobal) \ 120 V(InstanceOfKnownGlobal) \
120 V(InvokeFunction) \ 121 V(InvokeFunction) \
121 V(IsConstructCallAndBranch) \ 122 V(IsConstructCallAndBranch) \
122 V(IsNilAndBranch) \ 123 V(IsNilAndBranch) \
123 V(IsObjectAndBranch) \ 124 V(IsObjectAndBranch) \
125 V(IsSmiAndBranch) \
124 V(IsStringAndBranch) \ 126 V(IsStringAndBranch) \
125 V(IsSmiAndBranch) \
126 V(IsUndetectableAndBranch) \ 127 V(IsUndetectableAndBranch) \
127 V(JSArrayLength) \ 128 V(JSArrayLength) \
128 V(LeaveInlined) \ 129 V(LeaveInlined) \
130 V(LeaveTry) \
129 V(LoadContextSlot) \ 131 V(LoadContextSlot) \
130 V(LoadElements) \ 132 V(LoadElements) \
131 V(LoadExternalArrayPointer) \ 133 V(LoadExternalArrayPointer) \
132 V(LoadFunctionPrototype) \ 134 V(LoadFunctionPrototype) \
133 V(LoadGlobalCell) \ 135 V(LoadGlobalCell) \
134 V(LoadGlobalGeneric) \ 136 V(LoadGlobalGeneric) \
135 V(LoadKeyedFastDoubleElement) \ 137 V(LoadKeyedFastDoubleElement) \
136 V(LoadKeyedFastElement) \ 138 V(LoadKeyedFastElement) \
137 V(LoadKeyedGeneric) \ 139 V(LoadKeyedGeneric) \
138 V(LoadKeyedSpecializedArrayElement) \ 140 V(LoadKeyedSpecializedArrayElement) \
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 HValue* OperandAt(int i) { return inputs_[i]; } 934 HValue* OperandAt(int i) { return inputs_[i]; }
933 935
934 protected: 936 protected:
935 void InternalSetOperandAt(int i, HValue* value) { inputs_[i] = value; } 937 void InternalSetOperandAt(int i, HValue* value) { inputs_[i] = value; }
936 938
937 private: 939 private:
938 EmbeddedContainer<HValue*, V> inputs_; 940 EmbeddedContainer<HValue*, V> inputs_;
939 }; 941 };
940 942
941 943
944 template <>
945 class HTemplateInstruction<0> : public HInstruction {
946 public:
947 int OperandCount() { return 0; }
948 HValue* OperandAt(int i) {
949 UNREACHABLE();
950 return NULL;
951 }
952
953 virtual Representation RequiredInputRepresentation(int index) {
954 return Representation::None();
955 }
956
957 protected:
958 void InternalSetOperandAt(int i, HValue* value) { UNREACHABLE(); }
959 };
960
961
942 class HControlInstruction: public HInstruction { 962 class HControlInstruction: public HInstruction {
943 public: 963 public:
944 virtual HBasicBlock* SuccessorAt(int i) = 0; 964 virtual HBasicBlock* SuccessorAt(int i) = 0;
945 virtual int SuccessorCount() = 0; 965 virtual int SuccessorCount() = 0;
946 virtual void SetSuccessorAt(int i, HBasicBlock* block) = 0; 966 virtual void SetSuccessorAt(int i, HBasicBlock* block) = 0;
947 967
948 virtual void PrintDataTo(StringStream* stream); 968 virtual void PrintDataTo(StringStream* stream);
949 969
950 HBasicBlock* FirstSuccessor() { 970 HBasicBlock* FirstSuccessor() {
951 return SuccessorCount() > 0 ? SuccessorAt(0) : NULL; 971 return SuccessorCount() > 0 ? SuccessorAt(0) : NULL;
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 bool is_function_entry() { return type_ == kFunctionEntry; } 1424 bool is_function_entry() { return type_ == kFunctionEntry; }
1405 bool is_backwards_branch() { return type_ == kBackwardsBranch; } 1425 bool is_backwards_branch() { return type_ == kBackwardsBranch; }
1406 1426
1407 DECLARE_CONCRETE_INSTRUCTION(StackCheck) 1427 DECLARE_CONCRETE_INSTRUCTION(StackCheck)
1408 1428
1409 private: 1429 private:
1410 Type type_; 1430 Type type_;
1411 }; 1431 };
1412 1432
1413 1433
1434 class HEnterTry: public HTemplateInstruction<0> {
1435 public:
1436 explicit HEnterTry(int index) : index_(index) {
1437 SetAllSideEffects();
1438 }
1439
1440 DECLARE_CONCRETE_INSTRUCTION(EnterTry)
1441
1442 int index() { return index_; }
1443
1444 private:
1445 int index_;
1446 };
1447
1448
1449 class HLeaveTry: public HTemplateInstruction<0> {
1450 public:
1451 HLeaveTry() { SetAllSideEffects(); }
1452
1453 DECLARE_CONCRETE_INSTRUCTION(LeaveTry)
1454 };
1455
1456
1414 enum InliningKind { 1457 enum InliningKind {
1415 NORMAL_RETURN, // Normal function/method call and return. 1458 NORMAL_RETURN, // Normal function/method call and return.
1416 DROP_EXTRA_ON_RETURN, // Drop an extra value from the environment on return. 1459 DROP_EXTRA_ON_RETURN, // Drop an extra value from the environment on return.
1417 CONSTRUCT_CALL_RETURN, // Either use allocated receiver or return value. 1460 CONSTRUCT_CALL_RETURN, // Either use allocated receiver or return value.
1418 GETTER_CALL_RETURN, // Returning from a getter, need to restore context. 1461 GETTER_CALL_RETURN, // Returning from a getter, need to restore context.
1419 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. 1462 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value.
1420 }; 1463 };
1421 1464
1422 1465
1423 class HEnterInlined: public HTemplateInstruction<0> { 1466 class HEnterInlined: public HTemplateInstruction<0> {
(...skipping 3861 matching lines...) Expand 10 before | Expand all | Expand 10 after
5285 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); 5328 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex);
5286 }; 5329 };
5287 5330
5288 5331
5289 #undef DECLARE_INSTRUCTION 5332 #undef DECLARE_INSTRUCTION
5290 #undef DECLARE_CONCRETE_INSTRUCTION 5333 #undef DECLARE_CONCRETE_INSTRUCTION
5291 5334
5292 } } // namespace v8::internal 5335 } } // namespace v8::internal
5293 5336
5294 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 5337 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698