Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: src/hydrogen.h

Issue 11775016: Environment bookkeping has linear time complexity now, not a quadratic one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/data-flow.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 explicit HEnvironment(Zone* zone); 444 explicit HEnvironment(Zone* zone);
445 445
446 HEnvironment* arguments_environment() { 446 HEnvironment* arguments_environment() {
447 return outer()->frame_type() == ARGUMENTS_ADAPTOR ? outer() : this; 447 return outer()->frame_type() == ARGUMENTS_ADAPTOR ? outer() : this;
448 } 448 }
449 449
450 // Simple accessors. 450 // Simple accessors.
451 Handle<JSFunction> closure() const { return closure_; } 451 Handle<JSFunction> closure() const { return closure_; }
452 const ZoneList<HValue*>* values() const { return &values_; } 452 const ZoneList<HValue*>* values() const { return &values_; }
453 const ZoneList<int>* assigned_variables() const { 453 const GrowableBitVector* assigned_variables() const {
454 return &assigned_variables_; 454 return &assigned_variables_;
455 } 455 }
456 FrameType frame_type() const { return frame_type_; } 456 FrameType frame_type() const { return frame_type_; }
457 int parameter_count() const { return parameter_count_; } 457 int parameter_count() const { return parameter_count_; }
458 int specials_count() const { return specials_count_; } 458 int specials_count() const { return specials_count_; }
459 int local_count() const { return local_count_; } 459 int local_count() const { return local_count_; }
460 HEnvironment* outer() const { return outer_; } 460 HEnvironment* outer() const { return outer_; }
461 int pop_count() const { return pop_count_; } 461 int pop_count() const { return pop_count_; }
462 int push_count() const { return push_count_; } 462 int push_count() const { return push_count_; }
463 463
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 while (outer->frame_type() != JS_FUNCTION) outer = outer->outer_; 550 while (outer->frame_type() != JS_FUNCTION) outer = outer->outer_;
551 if (drop_extra) outer->Drop(1); 551 if (drop_extra) outer->Drop(1);
552 return outer; 552 return outer;
553 } 553 }
554 554
555 void AddIncomingEdge(HBasicBlock* block, HEnvironment* other); 555 void AddIncomingEdge(HBasicBlock* block, HEnvironment* other);
556 556
557 void ClearHistory() { 557 void ClearHistory() {
558 pop_count_ = 0; 558 pop_count_ = 0;
559 push_count_ = 0; 559 push_count_ = 0;
560 assigned_variables_.Rewind(0); 560 assigned_variables_.Clear();
561 } 561 }
562 562
563 void SetValueAt(int index, HValue* value) { 563 void SetValueAt(int index, HValue* value) {
564 ASSERT(index < length()); 564 ASSERT(index < length());
565 values_[index] = value; 565 values_[index] = value;
566 } 566 }
567 567
568 void PrintTo(StringStream* stream); 568 void PrintTo(StringStream* stream);
569 void PrintToStd(); 569 void PrintToStd();
570 570
(...skipping 28 matching lines...) Expand all
599 ASSERT(variable->IsStackAllocated()); 599 ASSERT(variable->IsStackAllocated());
600 int shift = variable->IsParameter() 600 int shift = variable->IsParameter()
601 ? 1 601 ? 1
602 : parameter_count_ + specials_count_; 602 : parameter_count_ + specials_count_;
603 return variable->index() + shift; 603 return variable->index() + shift;
604 } 604 }
605 605
606 Handle<JSFunction> closure_; 606 Handle<JSFunction> closure_;
607 // Value array [parameters] [specials] [locals] [temporaries]. 607 // Value array [parameters] [specials] [locals] [temporaries].
608 ZoneList<HValue*> values_; 608 ZoneList<HValue*> values_;
609 ZoneList<int> assigned_variables_; 609 GrowableBitVector assigned_variables_;
610 FrameType frame_type_; 610 FrameType frame_type_;
611 int parameter_count_; 611 int parameter_count_;
612 int specials_count_; 612 int specials_count_;
613 int local_count_; 613 int local_count_;
614 HEnvironment* outer_; 614 HEnvironment* outer_;
615 HEnterInlined* entry_; 615 HEnterInlined* entry_;
616 int pop_count_; 616 int pop_count_;
617 int push_count_; 617 int push_count_;
618 BailoutId ast_id_; 618 BailoutId ast_id_;
619 Zone* zone_; 619 Zone* zone_;
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 const char* filename_; 1555 const char* filename_;
1556 HeapStringAllocator string_allocator_; 1556 HeapStringAllocator string_allocator_;
1557 StringStream trace_; 1557 StringStream trace_;
1558 int indent_; 1558 int indent_;
1559 }; 1559 };
1560 1560
1561 1561
1562 } } // namespace v8::internal 1562 } } // namespace v8::internal
1563 1563
1564 #endif // V8_HYDROGEN_H_ 1564 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/data-flow.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698