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

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

Issue 2771443003: [kernel] Fix getter, run service tests in debug mode (Closed)
Patch Set: Re-insert assert, don't create getter for static field without initializer Created 3 years, 9 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/observatory/tests/service/service_kernel.status ('k') | no next file » | 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_reader.h" 5 #include "vm/kernel_reader.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 array_object ^= AsSortedDuplicateFreeArray( 555 array_object ^= AsSortedDuplicateFreeArray(
556 source_uri_index, &program_->yield_token_positions); 556 source_uri_index, &program_->yield_token_positions);
557 script.set_yield_positions(array_object); 557 script.set_yield_positions(array_object);
558 } 558 }
559 return script; 559 return script;
560 } 560 }
561 561
562 void KernelReader::GenerateFieldAccessors(const dart::Class& klass, 562 void KernelReader::GenerateFieldAccessors(const dart::Class& klass,
563 const dart::Field& field, 563 const dart::Field& field,
564 Field* kernel_field) { 564 Field* kernel_field) {
565 if (kernel_field->IsStatic() && kernel_field->initializer() == NULL) {
566 field.SetStaticValue(Instance::Handle(Z), true);
Kevin Millikin (Google) 2017/03/22 14:11:26 Comment: // Static fields without an initializer
567 return;
568 }
565 if (kernel_field->initializer() != NULL) { 569 if (kernel_field->initializer() != NULL) {
566 SimpleExpressionConverter converter(H.thread()); 570 SimpleExpressionConverter converter(H.thread());
567 const bool has_simple_initializer = 571 const bool has_simple_initializer =
568 converter.IsSimple(kernel_field->initializer()); 572 converter.IsSimple(kernel_field->initializer());
569 if (kernel_field->IsStatic()) { 573 if (kernel_field->IsStatic()) {
570 // Static fields with initializers either have the static value set to the 574 // Static fields with initializers either have the static value set to the
571 // initializer value if it is simple enough or else set to an 575 // initializer value if it is simple enough or else set to an
572 // uninitialized sentinel. 576 // uninitialized sentinel.
573 if (has_simple_initializer) { 577 if (has_simple_initializer) {
574 // We do not need a getter. 578 // We do not need a getter.
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 initializer_fun.set_is_debuggable(false); 834 initializer_fun.set_is_debuggable(false);
831 initializer_fun.set_is_reflectable(false); 835 initializer_fun.set_is_reflectable(false);
832 initializer_fun.set_is_inlinable(false); 836 initializer_fun.set_is_inlinable(false);
833 return new (zone) ParsedFunction(thread, initializer_fun); 837 return new (zone) ParsedFunction(thread, initializer_fun);
834 } 838 }
835 839
836 840
837 } // namespace kernel 841 } // namespace kernel
838 } // namespace dart 842 } // namespace dart
839 #endif // !defined(DART_PRECOMPILED_RUNTIME) 843 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/service_kernel.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698