| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 DISALLOW_COPY_AND_ASSIGN(HGraph); | 323 DISALLOW_COPY_AND_ASSIGN(HGraph); |
| 324 }; | 324 }; |
| 325 | 325 |
| 326 | 326 |
| 327 Zone* HBasicBlock::zone() { return graph_->zone(); } | 327 Zone* HBasicBlock::zone() { return graph_->zone(); } |
| 328 | 328 |
| 329 | 329 |
| 330 class HEnvironment: public ZoneObject { | 330 class HEnvironment: public ZoneObject { |
| 331 public: | 331 public: |
| 332 enum CompilationPhase { HYDROGEN, LITHIUM }; | |
| 333 | |
| 334 HEnvironment(HEnvironment* outer, | 332 HEnvironment(HEnvironment* outer, |
| 335 Scope* scope, | 333 Scope* scope, |
| 336 Handle<JSFunction> closure); | 334 Handle<JSFunction> closure); |
| 337 | 335 |
| 338 // Simple accessors. | 336 // Simple accessors. |
| 339 Handle<JSFunction> closure() const { return closure_; } | 337 Handle<JSFunction> closure() const { return closure_; } |
| 340 const ZoneList<HValue*>* values() const { return &values_; } | 338 const ZoneList<HValue*>* values() const { return &values_; } |
| 341 const ZoneList<int>* assigned_variables() const { | 339 const ZoneList<int>* assigned_variables() const { |
| 342 return &assigned_variables_; | 340 return &assigned_variables_; |
| 343 } | 341 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 } | 408 } |
| 411 | 409 |
| 412 void SetExpressionStackAt(int index_from_top, HValue* value); | 410 void SetExpressionStackAt(int index_from_top, HValue* value); |
| 413 | 411 |
| 414 HEnvironment* Copy() const; | 412 HEnvironment* Copy() const; |
| 415 HEnvironment* CopyWithoutHistory() const; | 413 HEnvironment* CopyWithoutHistory() const; |
| 416 HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; | 414 HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; |
| 417 | 415 |
| 418 // Create an "inlined version" of this environment, where the original | 416 // Create an "inlined version" of this environment, where the original |
| 419 // environment is the outer environment but the top expression stack | 417 // environment is the outer environment but the top expression stack |
| 420 // elements are moved to an inner environment as parameters. If | 418 // elements are moved to an inner environment as parameters. |
| 421 // is_speculative, the argument values are expected to be PushArgument | |
| 422 // instructions, otherwise they are the actual values. | |
| 423 HEnvironment* CopyForInlining(Handle<JSFunction> target, | 419 HEnvironment* CopyForInlining(Handle<JSFunction> target, |
| 424 FunctionLiteral* function, | 420 FunctionLiteral* function, |
| 425 CompilationPhase compilation_phase, | |
| 426 HConstant* undefined, | 421 HConstant* undefined, |
| 427 CallKind call_kind) const; | 422 CallKind call_kind) const; |
| 428 | 423 |
| 429 void AddIncomingEdge(HBasicBlock* block, HEnvironment* other); | 424 void AddIncomingEdge(HBasicBlock* block, HEnvironment* other); |
| 430 | 425 |
| 431 void ClearHistory() { | 426 void ClearHistory() { |
| 432 pop_count_ = 0; | 427 pop_count_ = 0; |
| 433 push_count_ = 0; | 428 push_count_ = 0; |
| 434 assigned_variables_.Rewind(0); | 429 assigned_variables_.Rewind(0); |
| 435 } | 430 } |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 // test contexts.) | 809 // test contexts.) |
| 815 void VisitForValue(Expression* expr, | 810 void VisitForValue(Expression* expr, |
| 816 ArgumentsAllowedFlag flag = ARGUMENTS_NOT_ALLOWED); | 811 ArgumentsAllowedFlag flag = ARGUMENTS_NOT_ALLOWED); |
| 817 void VisitForTypeOf(Expression* expr); | 812 void VisitForTypeOf(Expression* expr); |
| 818 void VisitForEffect(Expression* expr); | 813 void VisitForEffect(Expression* expr); |
| 819 void VisitForControl(Expression* expr, | 814 void VisitForControl(Expression* expr, |
| 820 HBasicBlock* true_block, | 815 HBasicBlock* true_block, |
| 821 HBasicBlock* false_block); | 816 HBasicBlock* false_block); |
| 822 | 817 |
| 823 // Visit an argument subexpression and emit a push to the outgoing | 818 // Visit an argument subexpression and emit a push to the outgoing |
| 824 // arguments. | 819 // arguments. Returns the hydrogen value that was pushed. |
| 825 void VisitArgument(Expression* expr); | 820 HValue* VisitArgument(Expression* expr); |
| 821 |
| 826 void VisitArgumentList(ZoneList<Expression*>* arguments); | 822 void VisitArgumentList(ZoneList<Expression*>* arguments); |
| 827 | 823 |
| 828 // Visit a list of expressions from left to right, each in a value context. | 824 // Visit a list of expressions from left to right, each in a value context. |
| 829 void VisitExpressions(ZoneList<Expression*>* exprs); | 825 void VisitExpressions(ZoneList<Expression*>* exprs); |
| 830 | 826 |
| 831 void AddPhi(HPhi* phi); | 827 void AddPhi(HPhi* phi); |
| 832 | 828 |
| 833 void PushAndAdd(HInstruction* instr); | 829 void PushAndAdd(HInstruction* instr); |
| 834 | 830 |
| 835 // Remove the arguments from the bailout environment and emit instructions | 831 // Remove the arguments from the bailout environment and emit instructions |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 const char* filename_; | 1210 const char* filename_; |
| 1215 HeapStringAllocator string_allocator_; | 1211 HeapStringAllocator string_allocator_; |
| 1216 StringStream trace_; | 1212 StringStream trace_; |
| 1217 int indent_; | 1213 int indent_; |
| 1218 }; | 1214 }; |
| 1219 | 1215 |
| 1220 | 1216 |
| 1221 } } // namespace v8::internal | 1217 } } // namespace v8::internal |
| 1222 | 1218 |
| 1223 #endif // V8_HYDROGEN_H_ | 1219 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |