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

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

Issue 904763003: Redesign inlining interval computation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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_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 4025 matching lines...) Expand 10 before | Expand all | Expand 10 after
4036 4036
4037 DISALLOW_COPY_AND_ASSIGN(Comments); 4037 DISALLOW_COPY_AND_ASSIGN(Comments);
4038 }; 4038 };
4039 4039
4040 4040
4041 const Comments& comments() const; 4041 const Comments& comments() const;
4042 void set_comments(const Comments& comments) const; 4042 void set_comments(const Comments& comments) const;
4043 4043
4044 enum InlinedIntervalEntries { 4044 enum InlinedIntervalEntries {
4045 kInlIntStart = 0, 4045 kInlIntStart = 0,
4046 kInlIntEnd = 1, 4046 kInlIntInliningId = 1,
4047 kInlIntFunction = 2, 4047 kInlIntCallerId = 2,
4048 kInlIntNumEntries = 3 4048 kInlIntNumEntries = 3,
4049 }; 4049 };
4050 4050
4051 RawArray* inlined_intervals() const { 4051 RawArray* inlined_intervals() const {
4052 return raw_ptr()->inlined_intervals_; 4052 return raw_ptr()->inlined_intervals_;
4053 } 4053 }
4054 void set_inlined_intervals(const Array& value) const; 4054 void set_inlined_intervals(const Array& value) const;
4055 4055
4056 RawArray* inlined_id_to_function() const {
4057 return raw_ptr()->inlined_id_to_function_;
4058 }
4059 void set_inlined_id_to_function(const Array& value) const;
4060
4056 void GetInlinedFunctionsAt( 4061 void GetInlinedFunctionsAt(
4057 intptr_t offset, GrowableArray<Function*>* fs) const; 4062 intptr_t offset, GrowableArray<Function*>* fs) const;
4058 4063
4059 void DumpInlinedIntervals() const; 4064 void DumpInlinedIntervals() const;
4060 4065
4061 RawLocalVarDescriptors* var_descriptors() const { 4066 RawLocalVarDescriptors* var_descriptors() const {
4062 return raw_ptr()->var_descriptors_; 4067 return raw_ptr()->var_descriptors_;
4063 } 4068 }
4064 void set_var_descriptors(const LocalVarDescriptors& value) const { 4069 void set_var_descriptors(const LocalVarDescriptors& value) const {
4065 ASSERT(value.IsOld()); 4070 ASSERT(value.IsOld());
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
4226 ASSERT(index >= 0); 4231 ASSERT(index >= 0);
4227 ASSERT(index < pointer_offsets_length()); 4232 ASSERT(index < pointer_offsets_length());
4228 // TODO(iposva): Unit test is missing for this functionality. 4233 // TODO(iposva): Unit test is missing for this functionality.
4229 return &UnsafeMutableNonPointer(raw_ptr()->data())[index]; 4234 return &UnsafeMutableNonPointer(raw_ptr()->data())[index];
4230 } 4235 }
4231 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) { 4236 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) {
4232 NoGCScope no_gc; 4237 NoGCScope no_gc;
4233 *PointerOffsetAddrAt(index) = offset_in_instructions; 4238 *PointerOffsetAddrAt(index) = offset_in_instructions;
4234 } 4239 }
4235 4240
4241 // Currently slow, as it searches linearly through inlined_intervals().
4242 intptr_t GetCallerId(intptr_t inlined_id) const;
4243
4236 intptr_t BinarySearchInSCallTable(uword pc) const; 4244 intptr_t BinarySearchInSCallTable(uword pc) const;
4237 static RawCode* LookupCodeInIsolate(Isolate* isolate, uword pc); 4245 static RawCode* LookupCodeInIsolate(Isolate* isolate, uword pc);
4238 4246
4239 // New is a private method as RawInstruction and RawCode objects should 4247 // New is a private method as RawInstruction and RawCode objects should
4240 // only be created using the Code::FinalizeCode method. This method creates 4248 // only be created using the Code::FinalizeCode method. This method creates
4241 // the RawInstruction and RawCode objects, sets up the pointer offsets 4249 // the RawInstruction and RawCode objects, sets up the pointer offsets
4242 // and links the two in a GC safe manner. 4250 // and links the two in a GC safe manner.
4243 static RawCode* New(intptr_t pointer_offsets_length); 4251 static RawCode* New(intptr_t pointer_offsets_length);
4244 4252
4245 FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object); 4253 FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object);
(...skipping 3546 matching lines...) Expand 10 before | Expand all | Expand 10 after
7792 7800
7793 7801
7794 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7802 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7795 intptr_t index) { 7803 intptr_t index) {
7796 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7804 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7797 } 7805 }
7798 7806
7799 } // namespace dart 7807 } // namespace dart
7800 7808
7801 #endif // VM_OBJECT_H_ 7809 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698