| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 void InsertRepresentationChanges(); | 231 void InsertRepresentationChanges(); |
| 232 void MarkDeoptimizeOnUndefined(); | 232 void MarkDeoptimizeOnUndefined(); |
| 233 void ComputeMinusZeroChecks(); | 233 void ComputeMinusZeroChecks(); |
| 234 bool ProcessArgumentsObject(); | 234 bool ProcessArgumentsObject(); |
| 235 void EliminateRedundantPhis(); | 235 void EliminateRedundantPhis(); |
| 236 void EliminateUnreachablePhis(); | 236 void EliminateUnreachablePhis(); |
| 237 void Canonicalize(); | 237 void Canonicalize(); |
| 238 void OrderBlocks(); | 238 void OrderBlocks(); |
| 239 void AssignDominators(); | 239 void AssignDominators(); |
| 240 void ReplaceCheckedValues(); | 240 void ReplaceCheckedValues(); |
| 241 void MarkAsDeoptimizingRecursively(HBasicBlock* block); | 241 void PropagateDeoptimizingMark(); |
| 242 | 242 |
| 243 // Returns false if there are phi-uses of the arguments-object | 243 // Returns false if there are phi-uses of the arguments-object |
| 244 // which are not supported by the optimizing compiler. | 244 // which are not supported by the optimizing compiler. |
| 245 bool CheckPhis(); |
| 246 |
| 247 // Returns false if there are phi-uses of hole values comming |
| 248 // from uninitialized consts. |
| 245 bool CollectPhis(); | 249 bool CollectPhis(); |
| 246 | 250 |
| 247 Handle<Code> Compile(CompilationInfo* info); | 251 Handle<Code> Compile(CompilationInfo* info); |
| 248 | 252 |
| 249 void set_undefined_constant(HConstant* constant) { | 253 void set_undefined_constant(HConstant* constant) { |
| 250 undefined_constant_.set(constant); | 254 undefined_constant_.set(constant); |
| 251 } | 255 } |
| 252 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); } | 256 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); } |
| 253 HConstant* GetConstant1(); | 257 HConstant* GetConstant1(); |
| 254 HConstant* GetConstantMinus1(); | 258 HConstant* GetConstantMinus1(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 BitVector* visited, | 290 BitVector* visited, |
| 287 ZoneList<HBasicBlock*>* order, | 291 ZoneList<HBasicBlock*>* order, |
| 288 HBasicBlock* loop_header); | 292 HBasicBlock* loop_header); |
| 289 void PostorderLoopBlocks(HLoopInformation* loop, | 293 void PostorderLoopBlocks(HLoopInformation* loop, |
| 290 BitVector* visited, | 294 BitVector* visited, |
| 291 ZoneList<HBasicBlock*>* order, | 295 ZoneList<HBasicBlock*>* order, |
| 292 HBasicBlock* loop_header); | 296 HBasicBlock* loop_header); |
| 293 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, | 297 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, |
| 294 Object* value); | 298 Object* value); |
| 295 | 299 |
| 300 void MarkAsDeoptimizingRecursively(HBasicBlock* block); |
| 296 void InsertTypeConversions(HInstruction* instr); | 301 void InsertTypeConversions(HInstruction* instr); |
| 297 void PropagateMinusZeroChecks(HValue* value, BitVector* visited); | 302 void PropagateMinusZeroChecks(HValue* value, BitVector* visited); |
| 298 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); | 303 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); |
| 299 void InsertRepresentationChangeForUse(HValue* value, | 304 void InsertRepresentationChangeForUse(HValue* value, |
| 300 HValue* use_value, | 305 HValue* use_value, |
| 301 int use_index, | 306 int use_index, |
| 302 Representation to); | 307 Representation to); |
| 303 void InsertRepresentationChangesForValue(HValue* value); | 308 void InsertRepresentationChangesForValue(HValue* value); |
| 304 void InferTypes(ZoneList<HValue*>* worklist); | 309 void InferTypes(ZoneList<HValue*>* worklist); |
| 305 void InitializeInferredTypes(int from_inclusive, int to_inclusive); | 310 void InitializeInferredTypes(int from_inclusive, int to_inclusive); |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 // Bailout environment manipulation. | 717 // Bailout environment manipulation. |
| 713 void Push(HValue* value) { environment()->Push(value); } | 718 void Push(HValue* value) { environment()->Push(value); } |
| 714 HValue* Pop() { return environment()->Pop(); } | 719 HValue* Pop() { return environment()->Pop(); } |
| 715 | 720 |
| 716 void Bailout(const char* reason); | 721 void Bailout(const char* reason); |
| 717 | 722 |
| 718 HBasicBlock* CreateJoin(HBasicBlock* first, | 723 HBasicBlock* CreateJoin(HBasicBlock* first, |
| 719 HBasicBlock* second, | 724 HBasicBlock* second, |
| 720 int join_id); | 725 int join_id); |
| 721 | 726 |
| 727 TypeFeedbackOracle* oracle() const { return function_state()->oracle(); } |
| 728 |
| 722 private: | 729 private: |
| 723 // Type of a member function that generates inline code for a native function. | 730 // Type of a member function that generates inline code for a native function. |
| 724 typedef void (HGraphBuilder::*InlineFunctionGenerator)(CallRuntime* call); | 731 typedef void (HGraphBuilder::*InlineFunctionGenerator)(CallRuntime* call); |
| 725 | 732 |
| 726 // Forward declarations for inner scope classes. | 733 // Forward declarations for inner scope classes. |
| 727 class SubgraphScope; | 734 class SubgraphScope; |
| 728 | 735 |
| 729 static const InlineFunctionGenerator kInlineFunctionGenerators[]; | 736 static const InlineFunctionGenerator kInlineFunctionGenerators[]; |
| 730 | 737 |
| 731 static const int kMaxCallPolymorphism = 4; | 738 static const int kMaxCallPolymorphism = 4; |
| 732 static const int kMaxLoadPolymorphism = 4; | 739 static const int kMaxLoadPolymorphism = 4; |
| 733 static const int kMaxStorePolymorphism = 4; | 740 static const int kMaxStorePolymorphism = 4; |
| 734 | 741 |
| 735 static const int kMaxInlinedNodes = 196; | 742 static const int kMaxInlinedNodes = 196; |
| 736 static const int kMaxInlinedSize = 196; | 743 static const int kMaxInlinedSize = 196; |
| 737 static const int kMaxSourceSize = 600; | 744 static const int kMaxSourceSize = 600; |
| 738 | 745 |
| 739 // Simple accessors. | 746 // Simple accessors. |
| 740 FunctionState* function_state() const { return function_state_; } | 747 FunctionState* function_state() const { return function_state_; } |
| 741 void set_function_state(FunctionState* state) { function_state_ = state; } | 748 void set_function_state(FunctionState* state) { function_state_ = state; } |
| 742 | 749 |
| 743 AstContext* ast_context() const { return ast_context_; } | 750 AstContext* ast_context() const { return ast_context_; } |
| 744 void set_ast_context(AstContext* context) { ast_context_ = context; } | 751 void set_ast_context(AstContext* context) { ast_context_ = context; } |
| 745 | 752 |
| 746 // Accessors forwarded to the function state. | 753 // Accessors forwarded to the function state. |
| 747 CompilationInfo* info() const { | 754 CompilationInfo* info() const { |
| 748 return function_state()->compilation_info(); | 755 return function_state()->compilation_info(); |
| 749 } | 756 } |
| 750 TypeFeedbackOracle* oracle() const { return function_state()->oracle(); } | |
| 751 | 757 |
| 752 AstContext* call_context() const { | 758 AstContext* call_context() const { |
| 753 return function_state()->call_context(); | 759 return function_state()->call_context(); |
| 754 } | 760 } |
| 755 HBasicBlock* function_return() const { | 761 HBasicBlock* function_return() const { |
| 756 return function_state()->function_return(); | 762 return function_state()->function_return(); |
| 757 } | 763 } |
| 758 TestContext* inlined_test_context() const { | 764 TestContext* inlined_test_context() const { |
| 759 return function_state()->test_context(); | 765 return function_state()->test_context(); |
| 760 } | 766 } |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 const char* filename_; | 1226 const char* filename_; |
| 1221 HeapStringAllocator string_allocator_; | 1227 HeapStringAllocator string_allocator_; |
| 1222 StringStream trace_; | 1228 StringStream trace_; |
| 1223 int indent_; | 1229 int indent_; |
| 1224 }; | 1230 }; |
| 1225 | 1231 |
| 1226 | 1232 |
| 1227 } } // namespace v8::internal | 1233 } } // namespace v8::internal |
| 1228 | 1234 |
| 1229 #endif // V8_HYDROGEN_H_ | 1235 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |