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

Side by Side Diff: runtime/vm/kernel_binary_flowgraph.cc

Issue 2956493003: [Kernel] Add check in the constant evaluator. (Closed)
Patch Set: Created 3 years, 6 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 | « runtime/vm/kernel_binary_flowgraph.h ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/kernel_binary_flowgraph.h" 5 #include "vm/kernel_binary_flowgraph.h"
6 6
7 #include "vm/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/longjump.h" 8 #include "vm/longjump.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 10
(...skipping 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 } else if (target.IsFactory() && type_arguments == NULL) { 2391 } else if (target.IsFactory() && type_arguments == NULL) {
2392 // All factories take a type arguments vector as first argument (independent 2392 // All factories take a type arguments vector as first argument (independent
2393 // of whether the class is generic or not). 2393 // of whether the class is generic or not).
2394 type_arguments = &TypeArguments::ZoneHandle(Z, TypeArguments::null()); 2394 type_arguments = &TypeArguments::ZoneHandle(Z, TypeArguments::null());
2395 } 2395 }
2396 return type_arguments; 2396 return type_arguments;
2397 } 2397 }
2398 2398
2399 bool StreamingConstantEvaluator::EvaluateBooleanExpressionHere() { 2399 bool StreamingConstantEvaluator::EvaluateBooleanExpressionHere() {
2400 EvaluateExpression(builder_->ReaderOffset(), false); 2400 EvaluateExpression(builder_->ReaderOffset(), false);
2401 AssertBoolInCheckedMode(); 2401 AssertBool();
2402 return result_.raw() == Bool::True().raw(); 2402 return result_.raw() == Bool::True().raw();
2403 } 2403 }
2404 2404
2405 bool StreamingConstantEvaluator::GetCachedConstant(intptr_t kernel_offset, 2405 bool StreamingConstantEvaluator::GetCachedConstant(intptr_t kernel_offset,
2406 Instance* value) { 2406 Instance* value) {
2407 if (builder_ == NULL || builder_->flow_graph_builder_ == NULL) return false; 2407 if (builder_ == NULL || builder_->flow_graph_builder_ == NULL) return false;
2408 2408
2409 const Function& function = builder_->parsed_function()->function(); 2409 const Function& function = builder_->parsed_function()->function();
2410 if (function.kind() == RawFunction::kImplicitStaticFinalGetter) { 2410 if (function.kind() == RawFunction::kImplicitStaticFinalGetter) {
2411 // Don't cache constants in initializer expressions. They get 2411 // Don't cache constants in initializer expressions. They get
(...skipping 4518 matching lines...) Expand 10 before | Expand all | Expand 10 after
6930 metadata_values.SetAt(i, value); 6930 metadata_values.SetAt(i, value);
6931 } 6931 }
6932 6932
6933 return metadata_values.raw(); 6933 return metadata_values.raw();
6934 } 6934 }
6935 6935
6936 } // namespace kernel 6936 } // namespace kernel
6937 } // namespace dart 6937 } // namespace dart
6938 6938
6939 #endif // !defined(DART_PRECOMPILED_RUNTIME) 6939 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/vm/kernel_binary_flowgraph.h ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698