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

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

Issue 16295022: Fix Issue 11047: use binary search instead of linear search to locate a pc-offset in the static cal… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « no previous file | 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 2973 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 int32_t* PointerOffsetAddrAt(int index) const { 2984 int32_t* PointerOffsetAddrAt(int index) const {
2985 ASSERT(index >= 0); 2985 ASSERT(index >= 0);
2986 ASSERT(index < pointer_offsets_length()); 2986 ASSERT(index < pointer_offsets_length());
2987 // TODO(iposva): Unit test is missing for this functionality. 2987 // TODO(iposva): Unit test is missing for this functionality.
2988 return &raw_ptr()->data_[index]; 2988 return &raw_ptr()->data_[index];
2989 } 2989 }
2990 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) { 2990 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) {
2991 *PointerOffsetAddrAt(index) = offset_in_instructions; 2991 *PointerOffsetAddrAt(index) = offset_in_instructions;
2992 } 2992 }
2993 2993
2994 intptr_t BinarySearchInSCallTable(uword pc) const;
2994 2995
2995 // New is a private method as RawInstruction and RawCode objects should 2996 // New is a private method as RawInstruction and RawCode objects should
2996 // only be created using the Code::FinalizeCode method. This method creates 2997 // only be created using the Code::FinalizeCode method. This method creates
2997 // the RawInstruction and RawCode objects, sets up the pointer offsets 2998 // the RawInstruction and RawCode objects, sets up the pointer offsets
2998 // and links the two in a GC safe manner. 2999 // and links the two in a GC safe manner.
2999 static RawCode* New(intptr_t pointer_offsets_length); 3000 static RawCode* New(intptr_t pointer_offsets_length);
3000 3001
3001 FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object); 3002 FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object);
3002 friend class Class; 3003 friend class Class;
3003 }; 3004 };
(...skipping 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after
5840 5841
5841 5842
5842 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 5843 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
5843 intptr_t index) { 5844 intptr_t index) {
5844 return array.At((index * kEntryLength) + kTargetFunctionIndex); 5845 return array.At((index * kEntryLength) + kTargetFunctionIndex);
5845 } 5846 }
5846 5847
5847 } // namespace dart 5848 } // namespace dart
5848 5849
5849 #endif // VM_OBJECT_H_ 5850 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698