OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 void EliminateRedundantPhis(); | 236 void EliminateRedundantPhis(); |
237 void EliminateUnreachablePhis(); | 237 void EliminateUnreachablePhis(); |
238 void Canonicalize(); | 238 void Canonicalize(); |
239 void OrderBlocks(); | 239 void OrderBlocks(); |
240 void AssignDominators(); | 240 void AssignDominators(); |
241 void ReplaceCheckedValues(); | 241 void ReplaceCheckedValues(); |
242 void PropagateDeoptimizingMark(); | 242 void PropagateDeoptimizingMark(); |
243 | 243 |
244 // Returns false if there are phi-uses of the arguments-object | 244 // Returns false if there are phi-uses of the arguments-object |
245 // which are not supported by the optimizing compiler. | 245 // which are not supported by the optimizing compiler. |
246 bool CheckPhis(); | 246 bool CheckArgumentsPhiUses(); |
247 | 247 |
248 // Returns false if there are phi-uses of hole values comming | 248 // Returns false if there are phi-uses of an uninitialized const |
249 // from uninitialized consts. | 249 // which are not supported by the optimizing compiler. |
250 bool CollectPhis(); | 250 bool CheckConstPhiUses(); |
| 251 |
| 252 void CollectPhis(); |
251 | 253 |
252 Handle<Code> Compile(CompilationInfo* info); | 254 Handle<Code> Compile(CompilationInfo* info); |
253 | 255 |
254 void set_undefined_constant(HConstant* constant) { | 256 void set_undefined_constant(HConstant* constant) { |
255 undefined_constant_.set(constant); | 257 undefined_constant_.set(constant); |
256 } | 258 } |
257 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); } | 259 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); } |
258 HConstant* GetConstant1(); | 260 HConstant* GetConstant1(); |
259 HConstant* GetConstantMinus1(); | 261 HConstant* GetConstantMinus1(); |
260 HConstant* GetConstantTrue(); | 262 HConstant* GetConstantTrue(); |
(...skipping 15 matching lines...) Expand all Loading... |
276 int GetNextValueID(HValue* value) { | 278 int GetNextValueID(HValue* value) { |
277 values_.Add(value); | 279 values_.Add(value); |
278 return values_.length() - 1; | 280 return values_.length() - 1; |
279 } | 281 } |
280 HValue* LookupValue(int id) const { | 282 HValue* LookupValue(int id) const { |
281 if (id >= 0 && id < values_.length()) return values_[id]; | 283 if (id >= 0 && id < values_.length()) return values_[id]; |
282 return NULL; | 284 return NULL; |
283 } | 285 } |
284 | 286 |
285 #ifdef DEBUG | 287 #ifdef DEBUG |
286 void Verify() const; | 288 void Verify(bool do_full_verify) const; |
287 #endif | 289 #endif |
288 | 290 |
289 private: | 291 private: |
290 void Postorder(HBasicBlock* block, | 292 void Postorder(HBasicBlock* block, |
291 BitVector* visited, | 293 BitVector* visited, |
292 ZoneList<HBasicBlock*>* order, | 294 ZoneList<HBasicBlock*>* order, |
293 HBasicBlock* loop_header); | 295 HBasicBlock* loop_header); |
294 void PostorderLoopBlocks(HLoopInformation* loop, | 296 void PostorderLoopBlocks(HLoopInformation* loop, |
295 BitVector* visited, | 297 BitVector* visited, |
296 ZoneList<HBasicBlock*>* order, | 298 ZoneList<HBasicBlock*>* order, |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 void HandleCompoundAssignment(Assignment* expr); | 905 void HandleCompoundAssignment(Assignment* expr); |
904 void HandlePolymorphicStoreNamedField(Assignment* expr, | 906 void HandlePolymorphicStoreNamedField(Assignment* expr, |
905 HValue* object, | 907 HValue* object, |
906 HValue* value, | 908 HValue* value, |
907 SmallMapList* types, | 909 SmallMapList* types, |
908 Handle<String> name); | 910 Handle<String> name); |
909 void HandlePolymorphicCallNamed(Call* expr, | 911 void HandlePolymorphicCallNamed(Call* expr, |
910 HValue* receiver, | 912 HValue* receiver, |
911 SmallMapList* types, | 913 SmallMapList* types, |
912 Handle<String> name); | 914 Handle<String> name); |
913 void HandleLiteralCompareTypeof(CompareOperation* compare_expr, | 915 bool TryLiteralCompare(CompareOperation* expr); |
914 Expression* expr, | 916 void HandleLiteralCompareTypeof(CompareOperation* expr, |
| 917 Expression* sub_expr, |
915 Handle<String> check); | 918 Handle<String> check); |
916 void HandleLiteralCompareUndefined(CompareOperation* compare_expr, | 919 void HandleLiteralCompareNil(CompareOperation* expr, |
917 Expression* expr); | 920 Expression* sub_expr, |
| 921 NilValue nil); |
918 | 922 |
919 HStringCharCodeAt* BuildStringCharCodeAt(HValue* context, | 923 HStringCharCodeAt* BuildStringCharCodeAt(HValue* context, |
920 HValue* string, | 924 HValue* string, |
921 HValue* index); | 925 HValue* index); |
922 HInstruction* BuildBinaryOperation(BinaryOperation* expr, | 926 HInstruction* BuildBinaryOperation(BinaryOperation* expr, |
923 HValue* left, | 927 HValue* left, |
924 HValue* right); | 928 HValue* right); |
925 HInstruction* BuildIncrement(bool returns_original_input, | 929 HInstruction* BuildIncrement(bool returns_original_input, |
926 CountOperation* expr); | 930 CountOperation* expr); |
927 HLoadNamedField* BuildLoadNamedField(HValue* object, | 931 HLoadNamedField* BuildLoadNamedField(HValue* object, |
928 Property* expr, | 932 Property* expr, |
929 Handle<Map> type, | 933 Handle<Map> type, |
930 LookupResult* result, | 934 LookupResult* result, |
931 bool smi_and_map_check); | 935 bool smi_and_map_check); |
932 HInstruction* BuildLoadNamedGeneric(HValue* object, Property* expr); | 936 HInstruction* BuildLoadNamedGeneric(HValue* object, Property* expr); |
933 HInstruction* BuildLoadKeyedGeneric(HValue* object, | 937 HInstruction* BuildLoadKeyedGeneric(HValue* object, |
934 HValue* key); | 938 HValue* key); |
935 HInstruction* BuildExternalArrayElementAccess( | 939 HInstruction* BuildExternalArrayElementAccess( |
936 HValue* external_elements, | 940 HValue* external_elements, |
937 HValue* checked_key, | 941 HValue* checked_key, |
938 HValue* val, | 942 HValue* val, |
939 ElementsKind elements_kind, | 943 ElementsKind elements_kind, |
940 bool is_store); | 944 bool is_store); |
| 945 HInstruction* BuildFastElementAccess(HValue* elements, |
| 946 HValue* checked_key, |
| 947 HValue* val, |
| 948 ElementsKind elements_kind, |
| 949 bool is_store); |
941 | 950 |
942 HInstruction* BuildMonomorphicElementAccess(HValue* object, | 951 HInstruction* BuildMonomorphicElementAccess(HValue* object, |
943 HValue* key, | 952 HValue* key, |
944 HValue* val, | 953 HValue* val, |
945 Expression* expr, | 954 Expression* expr, |
946 bool is_store); | 955 bool is_store); |
947 HValue* HandlePolymorphicElementAccess(HValue* object, | 956 HValue* HandlePolymorphicElementAccess(HValue* object, |
948 HValue* key, | 957 HValue* key, |
949 HValue* val, | 958 HValue* val, |
950 Expression* prop, | 959 Expression* prop, |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 const char* filename_; | 1241 const char* filename_; |
1233 HeapStringAllocator string_allocator_; | 1242 HeapStringAllocator string_allocator_; |
1234 StringStream trace_; | 1243 StringStream trace_; |
1235 int indent_; | 1244 int indent_; |
1236 }; | 1245 }; |
1237 | 1246 |
1238 | 1247 |
1239 } } // namespace v8::internal | 1248 } } // namespace v8::internal |
1240 | 1249 |
1241 #endif // V8_HYDROGEN_H_ | 1250 #endif // V8_HYDROGEN_H_ |
OLD | NEW |