| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 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 #ifndef V8_TEST_FEEDBACK_VECTOR_H_ | 5 #ifndef V8_TEST_FEEDBACK_VECTOR_H_ |
| 6 #define V8_TEST_FEEDBACK_VECTOR_H_ | 6 #define V8_TEST_FEEDBACK_VECTOR_H_ |
| 7 | 7 |
| 8 #include "src/objects.h" | 8 #include "src/objects.h" |
| 9 | 9 |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 int slot_count() const { return static_cast<int>(slots_.size()); } | 35 int slot_count() const { return static_cast<int>(slots_.size()); } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 Handle<FeedbackVector> vector_; | 38 Handle<FeedbackVector> vector_; |
| 39 std::vector<FeedbackSlot> slots_; | 39 std::vector<FeedbackSlot> slots_; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 template <typename Spec> | 42 template <typename Spec> |
| 43 Handle<FeedbackVector> NewFeedbackVector(Isolate* isolate, Spec* spec) { | 43 Handle<FeedbackVector> NewFeedbackVector(Isolate* isolate, Spec* spec) { |
| 44 Handle<FeedbackMetadata> metadata = FeedbackMetadata::New(isolate, spec); | 44 Handle<FeedbackMetadata> metadata = FeedbackMetadata::New(isolate, spec); |
| 45 return FeedbackVector::New(isolate, metadata); | 45 Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo( |
| 46 isolate->factory()->empty_string(), MaybeHandle<Code>(), false); |
| 47 shared->set_feedback_metadata(*metadata); |
| 48 return FeedbackVector::New(isolate, shared); |
| 46 } | 49 } |
| 47 | 50 |
| 48 template <typename Spec> | 51 template <typename Spec> |
| 49 Handle<FeedbackMetadata> NewFeedbackMetadata(Isolate* isolate, Spec* spec) { | 52 Handle<FeedbackMetadata> NewFeedbackMetadata(Isolate* isolate, Spec* spec) { |
| 50 return FeedbackMetadata::New(isolate, spec); | 53 return FeedbackMetadata::New(isolate, spec); |
| 51 } | 54 } |
| 52 | 55 |
| 53 } // namespace internal | 56 } // namespace internal |
| 54 } // namespace v8 | 57 } // namespace v8 |
| 55 | 58 |
| 56 #endif | 59 #endif |
| OLD | NEW |