| OLD | NEW |
| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 } | 306 } |
| 307 HValue* LookupValue(int id) const { | 307 HValue* LookupValue(int id) const { |
| 308 if (id >= 0 && id < values_.length()) return values_[id]; | 308 if (id >= 0 && id < values_.length()) return values_[id]; |
| 309 return NULL; | 309 return NULL; |
| 310 } | 310 } |
| 311 | 311 |
| 312 #ifdef DEBUG | 312 #ifdef DEBUG |
| 313 void Verify(bool do_full_verify) const; | 313 void Verify(bool do_full_verify) const; |
| 314 #endif | 314 #endif |
| 315 | 315 |
| 316 bool has_osr_loop_entry() { |
| 317 return osr_loop_entry_.is_set(); |
| 318 } |
| 319 |
| 320 HBasicBlock* osr_loop_entry() { |
| 321 return osr_loop_entry_.get(); |
| 322 } |
| 323 |
| 324 void set_osr_loop_entry(HBasicBlock* entry) { |
| 325 osr_loop_entry_.set(entry); |
| 326 } |
| 327 |
| 328 ZoneList<HUnknownOSRValue*>* osr_values() { |
| 329 return osr_values_.get(); |
| 330 } |
| 331 |
| 332 void set_osr_values(ZoneList<HUnknownOSRValue*>* values) { |
| 333 osr_values_.set(values); |
| 334 } |
| 335 |
| 316 private: | 336 private: |
| 317 void Postorder(HBasicBlock* block, | 337 void Postorder(HBasicBlock* block, |
| 318 BitVector* visited, | 338 BitVector* visited, |
| 319 ZoneList<HBasicBlock*>* order, | 339 ZoneList<HBasicBlock*>* order, |
| 320 HBasicBlock* loop_header); | 340 HBasicBlock* loop_header); |
| 321 void PostorderLoopBlocks(HLoopInformation* loop, | 341 void PostorderLoopBlocks(HLoopInformation* loop, |
| 322 BitVector* visited, | 342 BitVector* visited, |
| 323 ZoneList<HBasicBlock*>* order, | 343 ZoneList<HBasicBlock*>* order, |
| 324 HBasicBlock* loop_header); | 344 HBasicBlock* loop_header); |
| 325 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, | 345 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 346 ZoneList<HValue*> values_; | 366 ZoneList<HValue*> values_; |
| 347 ZoneList<HPhi*>* phi_list_; | 367 ZoneList<HPhi*>* phi_list_; |
| 348 SetOncePointer<HConstant> undefined_constant_; | 368 SetOncePointer<HConstant> undefined_constant_; |
| 349 SetOncePointer<HConstant> constant_1_; | 369 SetOncePointer<HConstant> constant_1_; |
| 350 SetOncePointer<HConstant> constant_minus1_; | 370 SetOncePointer<HConstant> constant_minus1_; |
| 351 SetOncePointer<HConstant> constant_true_; | 371 SetOncePointer<HConstant> constant_true_; |
| 352 SetOncePointer<HConstant> constant_false_; | 372 SetOncePointer<HConstant> constant_false_; |
| 353 SetOncePointer<HConstant> constant_hole_; | 373 SetOncePointer<HConstant> constant_hole_; |
| 354 SetOncePointer<HArgumentsObject> arguments_object_; | 374 SetOncePointer<HArgumentsObject> arguments_object_; |
| 355 | 375 |
| 376 SetOncePointer<HBasicBlock> osr_loop_entry_; |
| 377 SetOncePointer<ZoneList<HUnknownOSRValue*> > osr_values_; |
| 378 |
| 356 DISALLOW_COPY_AND_ASSIGN(HGraph); | 379 DISALLOW_COPY_AND_ASSIGN(HGraph); |
| 357 }; | 380 }; |
| 358 | 381 |
| 359 | 382 |
| 360 Zone* HBasicBlock::zone() { return graph_->zone(); } | 383 Zone* HBasicBlock::zone() { return graph_->zone(); } |
| 361 | 384 |
| 362 | 385 |
| 363 // Type of stack frame an environment might refer to. | 386 // Type of stack frame an environment might refer to. |
| 364 enum FrameType { JS_FUNCTION, JS_CONSTRUCT, ARGUMENTS_ADAPTOR }; | 387 enum FrameType { JS_FUNCTION, JS_CONSTRUCT, ARGUMENTS_ADAPTOR }; |
| 365 | 388 |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 void VisitTypeof(UnaryOperation* expr); | 902 void VisitTypeof(UnaryOperation* expr); |
| 880 void VisitAdd(UnaryOperation* expr); | 903 void VisitAdd(UnaryOperation* expr); |
| 881 void VisitSub(UnaryOperation* expr); | 904 void VisitSub(UnaryOperation* expr); |
| 882 void VisitBitNot(UnaryOperation* expr); | 905 void VisitBitNot(UnaryOperation* expr); |
| 883 void VisitNot(UnaryOperation* expr); | 906 void VisitNot(UnaryOperation* expr); |
| 884 | 907 |
| 885 void VisitComma(BinaryOperation* expr); | 908 void VisitComma(BinaryOperation* expr); |
| 886 void VisitLogicalExpression(BinaryOperation* expr); | 909 void VisitLogicalExpression(BinaryOperation* expr); |
| 887 void VisitArithmeticExpression(BinaryOperation* expr); | 910 void VisitArithmeticExpression(BinaryOperation* expr); |
| 888 | 911 |
| 889 void PreProcessOsrEntry(IterationStatement* statement); | 912 bool PreProcessOsrEntry(IterationStatement* statement); |
| 890 // True iff. we are compiling for OSR and the statement is the entry. | 913 // True iff. we are compiling for OSR and the statement is the entry. |
| 891 bool HasOsrEntryAt(IterationStatement* statement); | 914 bool HasOsrEntryAt(IterationStatement* statement); |
| 892 void VisitLoopBody(IterationStatement* stmt, | 915 void VisitLoopBody(IterationStatement* stmt, |
| 893 HBasicBlock* loop_entry, | 916 HBasicBlock* loop_entry, |
| 894 BreakAndContinueInfo* break_info); | 917 BreakAndContinueInfo* break_info); |
| 895 | 918 |
| 896 // Create a back edge in the flow graph. body_exit is the predecessor | 919 // Create a back edge in the flow graph. body_exit is the predecessor |
| 897 // block and loop_entry is the successor block. loop_successor is the | 920 // block and loop_entry is the successor block. loop_successor is the |
| 898 // block where control flow exits the loop normally (e.g., via failure of | 921 // block where control flow exits the loop normally (e.g., via failure of |
| 899 // the condition) and break_block is the block where control flow breaks | 922 // the condition) and break_block is the block where control flow breaks |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 const char* filename_; | 1366 const char* filename_; |
| 1344 HeapStringAllocator string_allocator_; | 1367 HeapStringAllocator string_allocator_; |
| 1345 StringStream trace_; | 1368 StringStream trace_; |
| 1346 int indent_; | 1369 int indent_; |
| 1347 }; | 1370 }; |
| 1348 | 1371 |
| 1349 | 1372 |
| 1350 } } // namespace v8::internal | 1373 } } // namespace v8::internal |
| 1351 | 1374 |
| 1352 #endif // V8_HYDROGEN_H_ | 1375 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |