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

Unified Diff: test/cctest/interpreter/interpreter-tester.h

Issue 2652893010: Interpreter tester should accept metadata instead of a vector (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/interpreter/interpreter-tester.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/interpreter-tester.h
diff --git a/test/cctest/interpreter/interpreter-tester.h b/test/cctest/interpreter/interpreter-tester.h
index 6719941f135de1f2c577902544d5b01ef5e6d8c5..bab6950a45a6135bf1af37134bdfb46fba3a13e2 100644
--- a/test/cctest/interpreter/interpreter-tester.h
+++ b/test/cctest/interpreter/interpreter-tester.h
@@ -39,6 +39,8 @@ class InterpreterCallable {
return CallInterpreter(isolate_, function_, args...);
}
+ TypeFeedbackVector* vector() const { return function_->feedback_vector(); }
+
private:
Isolate* isolate_;
Handle<JSFunction> function_;
@@ -52,12 +54,12 @@ class InterpreterTester {
public:
InterpreterTester(Isolate* isolate, const char* source,
MaybeHandle<BytecodeArray> bytecode,
- MaybeHandle<TypeFeedbackVector> feedback_vector,
+ MaybeHandle<TypeFeedbackMetadata> feedback_metadata,
const char* filter);
InterpreterTester(Isolate* isolate, Handle<BytecodeArray> bytecode,
- MaybeHandle<TypeFeedbackVector> feedback_vector =
- MaybeHandle<TypeFeedbackVector>(),
+ MaybeHandle<TypeFeedbackMetadata> feedback_metadata =
+ MaybeHandle<TypeFeedbackMetadata>(),
const char* filter = kFunctionName);
InterpreterTester(Isolate* isolate, const char* source,
@@ -84,7 +86,7 @@ class InterpreterTester {
Isolate* isolate_;
const char* source_;
MaybeHandle<BytecodeArray> bytecode_;
- MaybeHandle<TypeFeedbackVector> feedback_vector_;
+ MaybeHandle<TypeFeedbackMetadata> feedback_metadata_;
template <class... A>
Handle<JSFunction> GetBytecodeFunction() {
@@ -114,9 +116,13 @@ class InterpreterTester {
if (!bytecode_.is_null()) {
function->shared()->set_function_data(*bytecode_.ToHandleChecked());
}
- if (!feedback_vector_.is_null()) {
- function->literals()->set_feedback_vector(
- *feedback_vector_.ToHandleChecked());
+ if (!feedback_metadata_.is_null()) {
+ // TODO(mvstanton): The call to ClearOptimizedCodeMap can be removed
+ // when we stop storing literals in the optimized code map (upcoming CL).
+ function->shared()->ClearOptimizedCodeMap();
+ function->shared()->set_feedback_metadata(
+ *feedback_metadata_.ToHandleChecked());
+ JSFunction::EnsureLiterals(function);
}
return function;
}
« no previous file with comments | « no previous file | test/cctest/interpreter/interpreter-tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698