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

Unified Diff: src/feedback-slots.h

Issue 254623002: Simplify feedback vector creation and store in SharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code comments Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.cc ('k') | src/full-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/feedback-slots.h
diff --git a/src/feedback-slots.h b/src/feedback-slots.h
index 9760c652bcf4d37180e6e640657eb0d58ff9a738..c36fff445696074102beb729719a42d7c45a77a8 100644
--- a/src/feedback-slots.h
+++ b/src/feedback-slots.h
@@ -35,76 +35,16 @@
namespace v8 {
namespace internal {
-enum ComputablePhase {
- DURING_PARSE,
- AFTER_SCOPING
-};
-
-
class FeedbackSlotInterface {
public:
static const int kInvalidFeedbackSlot = -1;
virtual ~FeedbackSlotInterface() {}
- // When can we ask how many feedback slots are necessary?
- virtual ComputablePhase GetComputablePhase() = 0;
- virtual int ComputeFeedbackSlotCount(Isolate* isolate) = 0;
+ virtual int ComputeFeedbackSlotCount() = 0;
virtual void SetFirstFeedbackSlot(int slot) = 0;
};
-
-class DeferredFeedbackSlotProcessor {
- public:
- DeferredFeedbackSlotProcessor()
- : slot_nodes_(NULL),
- slot_count_(0) { }
-
- void add_slot_node(Zone* zone, FeedbackSlotInterface* slot) {
- if (slot->GetComputablePhase() == DURING_PARSE) {
- // No need to add to the list
- int count = slot->ComputeFeedbackSlotCount(zone->isolate());
- slot->SetFirstFeedbackSlot(slot_count_);
- slot_count_ += count;
- } else {
- if (slot_nodes_ == NULL) {
- slot_nodes_ = new(zone) ZoneList<FeedbackSlotInterface*>(10, zone);
- }
- slot_nodes_->Add(slot, zone);
- }
- }
-
- void ProcessFeedbackSlots(Isolate* isolate) {
- // Scope analysis must have been done.
- if (slot_nodes_ == NULL) {
- return;
- }
-
- int current_slot = slot_count_;
- for (int i = 0; i < slot_nodes_->length(); i++) {
- FeedbackSlotInterface* slot_interface = slot_nodes_->at(i);
- int count = slot_interface->ComputeFeedbackSlotCount(isolate);
- if (count > 0) {
- slot_interface->SetFirstFeedbackSlot(current_slot);
- current_slot += count;
- }
- }
-
- slot_count_ = current_slot;
- slot_nodes_->Clear();
- }
-
- int slot_count() {
- ASSERT(slot_count_ >= 0);
- return slot_count_;
- }
-
- private:
- ZoneList<FeedbackSlotInterface*>* slot_nodes_;
- int slot_count_;
-};
-
-
} } // namespace v8::internal
#endif // V8_FEEDBACK_SLOTS_H_
« no previous file with comments | « src/factory.cc ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698