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

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

Issue 2126393003: Cache compile-time constants on the script object, sometimes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review Created 4 years, 5 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/object.cc ('k') | runtime/vm/object_store.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_STORE_H_ 5 #ifndef VM_OBJECT_STORE_H_
6 #define VM_OBJECT_STORE_H_ 6 #define VM_OBJECT_STORE_H_
7 7
8 #include "vm/object.h" 8 #include "vm/object.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 RawArray* library_load_error_table() const { 433 RawArray* library_load_error_table() const {
434 return library_load_error_table_; 434 return library_load_error_table_;
435 } 435 }
436 void set_library_load_error_table(const Array& table) { 436 void set_library_load_error_table(const Array& table) {
437 library_load_error_table_ = table.raw(); 437 library_load_error_table_ = table.raw();
438 } 438 }
439 static intptr_t library_load_error_table_offset() { 439 static intptr_t library_load_error_table_offset() {
440 return OFFSET_OF(ObjectStore, library_load_error_table_); 440 return OFFSET_OF(ObjectStore, library_load_error_table_);
441 } 441 }
442 442
443 RawArray* compile_time_constants() const { 443 RawArray* vm_compile_time_constants() const {
444 return compile_time_constants_; 444 return vm_compile_time_constants_;
445 } 445 }
446 void set_compile_time_constants(const Array& value) { 446 void set_vm_compile_time_constants(const Array& value) {
447 compile_time_constants_ = value.raw(); 447 vm_compile_time_constants_ = value.raw();
448 } 448 }
449 449
450 RawArray* unique_dynamic_targets() const { 450 RawArray* unique_dynamic_targets() const {
451 return unique_dynamic_targets_; 451 return unique_dynamic_targets_;
452 } 452 }
453 void set_unique_dynamic_targets(const Array& value) { 453 void set_unique_dynamic_targets(const Array& value) {
454 unique_dynamic_targets_ = value.raw(); 454 unique_dynamic_targets_ = value.raw();
455 } 455 }
456 456
457 RawGrowableObjectArray* token_objects() const { 457 RawGrowableObjectArray* token_objects() const {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 V(RawGrowableObjectArray*, error_listeners_) \ 572 V(RawGrowableObjectArray*, error_listeners_) \
573 V(RawContext*, empty_context_) \ 573 V(RawContext*, empty_context_) \
574 V(RawInstance*, stack_overflow_) \ 574 V(RawInstance*, stack_overflow_) \
575 V(RawInstance*, out_of_memory_) \ 575 V(RawInstance*, out_of_memory_) \
576 V(RawUnhandledException*, preallocated_unhandled_exception_) \ 576 V(RawUnhandledException*, preallocated_unhandled_exception_) \
577 V(RawStacktrace*, preallocated_stack_trace_) \ 577 V(RawStacktrace*, preallocated_stack_trace_) \
578 V(RawFunction*, lookup_port_handler_) \ 578 V(RawFunction*, lookup_port_handler_) \
579 V(RawTypedData*, empty_uint32_array_) \ 579 V(RawTypedData*, empty_uint32_array_) \
580 V(RawFunction*, handle_message_function_) \ 580 V(RawFunction*, handle_message_function_) \
581 V(RawArray*, library_load_error_table_) \ 581 V(RawArray*, library_load_error_table_) \
582 V(RawArray*, compile_time_constants_) \ 582 V(RawArray*, vm_compile_time_constants_) \
583 V(RawArray*, unique_dynamic_targets_) \ 583 V(RawArray*, unique_dynamic_targets_) \
584 V(RawGrowableObjectArray*, token_objects_) \ 584 V(RawGrowableObjectArray*, token_objects_) \
585 V(RawArray*, token_objects_map_) \ 585 V(RawArray*, token_objects_map_) \
586 V(RawGrowableObjectArray*, megamorphic_cache_table_) \ 586 V(RawGrowableObjectArray*, megamorphic_cache_table_) \
587 V(RawCode*, megamorphic_miss_code_) \ 587 V(RawCode*, megamorphic_miss_code_) \
588 V(RawFunction*, megamorphic_miss_function_) \ 588 V(RawFunction*, megamorphic_miss_function_) \
589 589
590 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); } 590 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); }
591 #define DECLARE_OBJECT_STORE_FIELD(type, name) \ 591 #define DECLARE_OBJECT_STORE_FIELD(type, name) \
592 type name; 592 type name;
593 OBJECT_STORE_FIELD_LIST(DECLARE_OBJECT_STORE_FIELD) 593 OBJECT_STORE_FIELD_LIST(DECLARE_OBJECT_STORE_FIELD)
594 #undef DECLARE_OBJECT_STORE_FIELD 594 #undef DECLARE_OBJECT_STORE_FIELD
595 RawObject** to() { 595 RawObject** to() {
596 return reinterpret_cast<RawObject**>(&megamorphic_miss_function_); 596 return reinterpret_cast<RawObject**>(&megamorphic_miss_function_);
597 } 597 }
598 RawObject** to_snapshot(Snapshot::Kind kind) { 598 RawObject** to_snapshot(Snapshot::Kind kind) {
599 switch (kind) { 599 switch (kind) {
600 case Snapshot::kCore: 600 case Snapshot::kCore:
601 return reinterpret_cast<RawObject**>(&compile_time_constants_); 601 return reinterpret_cast<RawObject**>(&vm_compile_time_constants_);
602 case Snapshot::kAppWithJIT: 602 case Snapshot::kAppWithJIT:
603 case Snapshot::kAppNoJIT: 603 case Snapshot::kAppNoJIT:
604 return to(); 604 return to();
605 case Snapshot::kScript: 605 case Snapshot::kScript:
606 case Snapshot::kMessage: 606 case Snapshot::kMessage:
607 case Snapshot::kNone: 607 case Snapshot::kNone:
608 case Snapshot::kInvalid: 608 case Snapshot::kInvalid:
609 break; 609 break;
610 } 610 }
611 UNREACHABLE(); 611 UNREACHABLE();
612 return NULL; 612 return NULL;
613 } 613 }
614 614
615 friend class Serializer; 615 friend class Serializer;
616 friend class Deserializer; 616 friend class Deserializer;
617 617
618 DISALLOW_COPY_AND_ASSIGN(ObjectStore); 618 DISALLOW_COPY_AND_ASSIGN(ObjectStore);
619 }; 619 };
620 620
621 } // namespace dart 621 } // namespace dart
622 622
623 #endif // VM_OBJECT_STORE_H_ 623 #endif // VM_OBJECT_STORE_H_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/object_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698