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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 const char* filename_; | 1209 const char* filename_; |
1215 HeapStringAllocator string_allocator_; | 1210 HeapStringAllocator string_allocator_; |
1216 StringStream trace_; | 1211 StringStream trace_; |
1217 int indent_; | 1212 int indent_; |
1218 }; | 1213 }; |
1219 | 1214 |
1220 | 1215 |
1221 } } // namespace v8::internal | 1216 } } // namespace v8::internal |
1222 | 1217 |
1223 #endif // V8_HYDROGEN_H_ | 1218 #endif // V8_HYDROGEN_H_ |
OLD | NEW |