| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/ast-numbering.h" | 5 #include "src/ast-numbering.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/scopes.h" | 8 #include "src/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 if (FLAG_turbo_shipping) { | 58 if (FLAG_turbo_shipping) { |
| 59 properties_.flags() |= AstProperties::kDontCrankshaft; | 59 properties_.flags() |= AstProperties::kDontCrankshaft; |
| 60 } else { | 60 } else { |
| 61 dont_optimize_reason_ = reason; | 61 dont_optimize_reason_ = reason; |
| 62 DisableSelfOptimization(); | 62 DisableSelfOptimization(); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 template <typename Node> | 66 template <typename Node> |
| 67 void ReserveFeedbackSlots(Node* node) { | 67 void ReserveFeedbackSlots(Node* node) { |
| 68 FeedbackVectorRequirements reqs = | 68 node->AssignFeedbackVectorSlots(isolate(), properties_.get_spec(), |
| 69 node->ComputeFeedbackRequirements(isolate(), &ic_slot_cache_); | 69 &ic_slot_cache_); |
| 70 if (reqs.slots() > 0) { | |
| 71 node->SetFirstFeedbackSlot(FeedbackVectorSlot(properties_.slots())); | |
| 72 properties_.increase_slots(reqs.slots()); | |
| 73 } | |
| 74 if (reqs.ic_slots() > 0) { | |
| 75 int ic_slots = properties_.ic_slots(); | |
| 76 node->SetFirstFeedbackICSlot(FeedbackVectorICSlot(ic_slots), | |
| 77 &ic_slot_cache_); | |
| 78 properties_.increase_ic_slots(reqs.ic_slots()); | |
| 79 for (int i = 0; i < reqs.ic_slots(); i++) { | |
| 80 properties_.SetKind(ic_slots + i, node->FeedbackICSlotKind(i)); | |
| 81 } | |
| 82 } | |
| 83 } | 70 } |
| 84 | 71 |
| 85 BailoutReason dont_optimize_reason() const { return dont_optimize_reason_; } | 72 BailoutReason dont_optimize_reason() const { return dont_optimize_reason_; } |
| 86 | 73 |
| 87 int next_id_; | 74 int next_id_; |
| 88 AstProperties properties_; | 75 AstProperties properties_; |
| 89 // The slot cache allows us to reuse certain vector IC slots. | 76 // The slot cache allows us to reuse certain vector IC slots. |
| 90 ICSlotCache ic_slot_cache_; | 77 ICSlotCache ic_slot_cache_; |
| 91 BailoutReason dont_optimize_reason_; | 78 BailoutReason dont_optimize_reason_; |
| 92 | 79 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 } | 570 } |
| 584 | 571 |
| 585 | 572 |
| 586 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 573 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 587 FunctionLiteral* function) { | 574 FunctionLiteral* function) { |
| 588 AstNumberingVisitor visitor(isolate, zone); | 575 AstNumberingVisitor visitor(isolate, zone); |
| 589 return visitor.Renumber(function); | 576 return visitor.Renumber(function); |
| 590 } | 577 } |
| 591 } // namespace internal | 578 } // namespace internal |
| 592 } // namespace v8 | 579 } // namespace v8 |
| OLD | NEW |