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

Side by Side Diff: test/cctest/test-feedback-vector.h

Issue 1370303004: Distinction between FeedbackVectorICSlot and FeedbackVectorSlot eliminated. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed release builds Created 5 years, 2 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
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_TEST_FEEDBACK_VECTOR_H_
6 #define V8_TEST_FEEDBACK_VECTOR_H_
7
8 #include "src/objects.h"
9
10
11 namespace v8 {
12 namespace internal {
13
14 // Helper class that allows to write tests in a slot size independent manner.
15 // Use helper.slot(X) to get X'th slot identifier.
16 class FeedbackVectorHelper {
17 public:
18 explicit FeedbackVectorHelper(Handle<TypeFeedbackVector> vector)
19 : vector_(vector) {
20 int slot_count = vector->Slots();
21 slots_.reserve(slot_count);
22 TypeFeedbackMetadataIterator iter(vector);
23 while (iter.HasNext()) {
24 FeedbackVectorSlot slot = iter.Next();
25 slots_.push_back(slot);
26 }
27 }
28
29 Handle<TypeFeedbackVector> vector() { return vector_; }
30
31 // Returns slot identifier by numerical index.
32 FeedbackVectorSlot slot(int index) const { return slots_[index]; }
33
34 // Returns the number of slots in the feedback vector.
35 int slot_count() const { return static_cast<int>(slots_.size()); }
36
37 private:
38 Handle<TypeFeedbackVector> vector_;
39 std::vector<FeedbackVectorSlot> slots_;
40 };
41
42 } // namespace internal
43 } // namespace v8
44
45 #endif
OLDNEW
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698