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

Side by Side Diff: runtime/vm/object.h

Issue 14969019: A load static of an initialized static final field can be converted to its value, as long as it is … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 ASSERT(sentinel_ != NULL); 314 ASSERT(sentinel_ != NULL);
315 return *sentinel_; 315 return *sentinel_;
316 } 316 }
317 // Value marking that we are transitioning from sentinel, e.g., computing 317 // Value marking that we are transitioning from sentinel, e.g., computing
318 // a field value. Used to detect circular initialization. 318 // a field value. Used to detect circular initialization.
319 static const Instance& transition_sentinel() { 319 static const Instance& transition_sentinel() {
320 ASSERT(transition_sentinel_ != NULL); 320 ASSERT(transition_sentinel_ != NULL);
321 return *transition_sentinel_; 321 return *transition_sentinel_;
322 } 322 }
323 323
324 // Compiler's constant propagation constants.
325 static const Instance& unknown_constant() {
326 ASSERT(unknown_constant_ != NULL);
327 return *unknown_constant_;
328 }
329 static const Instance& non_constant() {
330 ASSERT(non_constant_ != NULL);
331 return *non_constant_;
332 }
333
324 static const Bool& bool_true() { 334 static const Bool& bool_true() {
325 ASSERT(bool_true_ != NULL); 335 ASSERT(bool_true_ != NULL);
326 return *bool_true_; 336 return *bool_true_;
327 } 337 }
328 static const Bool& bool_false() { 338 static const Bool& bool_false() {
329 ASSERT(bool_false_ != NULL); 339 ASSERT(bool_false_ != NULL);
330 return *bool_false_; 340 return *bool_false_;
331 } 341 }
332 static const LanguageError& snapshot_writer_error() { 342 static const LanguageError& snapshot_writer_error() {
333 ASSERT(snapshot_writer_error_ != NULL); 343 ASSERT(snapshot_writer_error_ != NULL);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 static RawClass* api_error_class_; // Class of ApiError. 526 static RawClass* api_error_class_; // Class of ApiError.
517 static RawClass* language_error_class_; // Class of LanguageError. 527 static RawClass* language_error_class_; // Class of LanguageError.
518 static RawClass* unhandled_exception_class_; // Class of UnhandledException. 528 static RawClass* unhandled_exception_class_; // Class of UnhandledException.
519 static RawClass* unwind_error_class_; // Class of UnwindError. 529 static RawClass* unwind_error_class_; // Class of UnwindError.
520 530
521 // The static values below are read-only handle pointers for singleton 531 // The static values below are read-only handle pointers for singleton
522 // objects that are shared between the different isolates. 532 // objects that are shared between the different isolates.
523 static Array* empty_array_; 533 static Array* empty_array_;
524 static Instance* sentinel_; 534 static Instance* sentinel_;
525 static Instance* transition_sentinel_; 535 static Instance* transition_sentinel_;
536 static Instance* unknown_constant_;
537 static Instance* non_constant_;
526 static Bool* bool_true_; 538 static Bool* bool_true_;
527 static Bool* bool_false_; 539 static Bool* bool_false_;
528 static LanguageError* snapshot_writer_error_; 540 static LanguageError* snapshot_writer_error_;
529 541
530 friend void ClassTable::Register(const Class& cls); 542 friend void ClassTable::Register(const Class& cls);
531 friend void RawObject::Validate(Isolate* isolate) const; 543 friend void RawObject::Validate(Isolate* isolate) const;
532 friend class Closure; 544 friend class Closure;
533 friend class SnapshotReader; 545 friend class SnapshotReader;
534 friend class OneByteString; 546 friend class OneByteString;
535 friend class TwoByteString; 547 friend class TwoByteString;
(...skipping 5202 matching lines...) Expand 10 before | Expand all | Expand 10 after
5738 5750
5739 5751
5740 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 5752 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
5741 intptr_t index) { 5753 intptr_t index) {
5742 return array.At((index * kEntryLength) + kTargetFunctionIndex); 5754 return array.At((index * kEntryLength) + kTargetFunctionIndex);
5743 } 5755 }
5744 5756
5745 } // namespace dart 5757 } // namespace dart
5746 5758
5747 #endif // VM_OBJECT_H_ 5759 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698