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

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

Issue 9395016: First part of new ICData infrastructure: use a wrapper object instead of an array. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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
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_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/snapshot.h" 10 #include "vm/snapshot.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 V(ExternalFourByteString) \ 58 V(ExternalFourByteString) \
59 V(Bool) \ 59 V(Bool) \
60 V(Array) \ 60 V(Array) \
61 V(ImmutableArray) \ 61 V(ImmutableArray) \
62 V(ByteArray) \ 62 V(ByteArray) \
63 V(InternalByteArray) \ 63 V(InternalByteArray) \
64 V(ExternalByteArray) \ 64 V(ExternalByteArray) \
65 V(Closure) \ 65 V(Closure) \
66 V(Stacktrace) \ 66 V(Stacktrace) \
67 V(JSRegExp) \ 67 V(JSRegExp) \
68 V(ICData) \
68 69
69 #define CLASS_LIST(V) \ 70 #define CLASS_LIST(V) \
70 V(Object) \ 71 V(Object) \
71 CLASS_LIST_NO_OBJECT(V) 72 CLASS_LIST_NO_OBJECT(V)
72 73
73 74
74 // Forward declarations. 75 // Forward declarations.
75 class Isolate; 76 class Isolate;
76 #define DEFINE_FORWARD_DECLARATION(clazz) \ 77 #define DEFINE_FORWARD_DECLARATION(clazz) \
77 class Raw##clazz; 78 class Raw##clazz;
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 RAW_HEAP_OBJECT_IMPLEMENTATION(Code); 629 RAW_HEAP_OBJECT_IMPLEMENTATION(Code);
629 630
630 RawObject** from() { 631 RawObject** from() {
631 return reinterpret_cast<RawObject**>(&ptr()->instructions_); 632 return reinterpret_cast<RawObject**>(&ptr()->instructions_);
632 } 633 }
633 RawInstructions* instructions_; 634 RawInstructions* instructions_;
634 RawFunction* function_; 635 RawFunction* function_;
635 RawExceptionHandlers* exception_handlers_; 636 RawExceptionHandlers* exception_handlers_;
636 RawPcDescriptors* pc_descriptors_; 637 RawPcDescriptors* pc_descriptors_;
637 RawLocalVarDescriptors* var_descriptors_; 638 RawLocalVarDescriptors* var_descriptors_;
638 // Ongoing redesign of inline caches may soon remove the need for 'ic_data_'.
639 RawArray* ic_data_; // Used to store IC stub data (see class ICData).
640 RawObject** to() { 639 RawObject** to() {
641 return reinterpret_cast<RawObject**>(&ptr()->ic_data_); 640 return reinterpret_cast<RawObject**>(&ptr()->var_descriptors_);
642 } 641 }
643 642
644 intptr_t pointer_offsets_length_; 643 intptr_t pointer_offsets_length_;
645 // This cannot be boolean because of alignment issues on x64 architectures. 644 // This cannot be boolean because of alignment issues on x64 architectures.
646 intptr_t is_optimized_; 645 intptr_t is_optimized_;
647 646
648 // Variable length data follows here. 647 // Variable length data follows here.
649 int32_t data_[0]; 648 int32_t data_[0];
650 }; 649 };
651 650
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 return reinterpret_cast<RawObject**>(&ptr()->pattern_); 1075 return reinterpret_cast<RawObject**>(&ptr()->pattern_);
1077 } 1076 }
1078 1077
1079 intptr_t type_; // Uninitialized, simple or complex. 1078 intptr_t type_; // Uninitialized, simple or complex.
1080 intptr_t flags_; // Represents global/local, case insensitive, multiline. 1079 intptr_t flags_; // Represents global/local, case insensitive, multiline.
1081 1080
1082 // Variable length data follows here. 1081 // Variable length data follows here.
1083 uint8_t data_[0]; 1082 uint8_t data_[0];
1084 }; 1083 };
1085 1084
1085
1086 class RawICData : public RawInstance {
1087 RAW_HEAP_OBJECT_IMPLEMENTATION(ICData);
1088
1089 RawObject** from() {
1090 return reinterpret_cast<RawObject**>(&ptr()->function_);
1091 }
1092
1093 RawObject** to() {
1094 return reinterpret_cast<RawObject**>(&ptr()->ic_data_);
1095 }
1096
1097 RawFunction* function_; // Parent/calling function of this IC.
1098 RawString* target_name_; // Name of target function.
1099 RawArray* ic_data_; // Contains test classes and target function.
1100 intptr_t id_; // Parser node id corresponding to this IC.
1101 intptr_t num_args_tested_; // Number of arguments tested in IC.
1102 };
1103
1104
1086 } // namespace dart 1105 } // namespace dart
1087 1106
1088 #endif // VM_RAW_OBJECT_H_ 1107 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698