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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2857853003: Fix building of parameter descriptors from Kernel (Closed)
Patch Set: Created 3 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 | « runtime/vm/kernel_to_il.h ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index 001127cb58effbf73ae2f613a1aca387a704534a..35062e9e32436f17ae4292dae9320c81afe582e0 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -6778,11 +6778,12 @@ RawObject* EvaluateMetadata(const dart::Field& metadata_field) {
}
-RawObject* BuildParameterDescriptor(TreeNode* const kernel_node) {
+RawObject* BuildParameterDescriptor(const Function& function) {
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
+ TreeNode* kernel_node =
+ reinterpret_cast<TreeNode*>(function.kernel_function());
FunctionNode* function_node = NULL;
-
if (kernel_node->IsProcedure()) {
function_node = Procedure::Cast(kernel_node)->function();
} else if (kernel_node->IsConstructor()) {
@@ -6796,10 +6797,14 @@ RawObject* BuildParameterDescriptor(TreeNode* const kernel_node) {
Thread* thread = Thread::Current();
Zone* zone_ = thread->zone();
- TranslationHelper translation_helper(thread);
- DartTypeTranslator type_translator(&translation_helper, NULL, true);
+ TranslationHelper helper(thread);
+ Script& script = Script::Handle(Z, function.script());
+ helper.SetStringOffsets(
+ TypedData::Handle(Z, script.kernel_string_offsets()));
+ helper.SetStringData(TypedData::Handle(Z, script.kernel_string_data()));
+ DartTypeTranslator type_translator(&helper, NULL, true);
ConstantEvaluator constant_evaluator(/* flow_graph_builder = */ NULL, Z,
- &translation_helper, &type_translator);
+ &helper, &type_translator);
const intptr_t positional_count =
function_node->positional_parameters().length();
« no previous file with comments | « runtime/vm/kernel_to_il.h ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698