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

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

Issue 11564029: Implement Function.apply in vm (issue 5670). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3183 bool IsValidNativeIndex(int index) const { 3183 bool IsValidNativeIndex(int index) const {
3184 return ((index >= 0) && (index < clazz()->ptr()->num_native_fields_)); 3184 return ((index >= 0) && (index < clazz()->ptr()->num_native_fields_));
3185 } 3185 }
3186 3186
3187 inline intptr_t GetNativeField(Isolate* isolate, int index) const; 3187 inline intptr_t GetNativeField(Isolate* isolate, int index) const;
3188 void SetNativeField(int index, intptr_t value) const; 3188 void SetNativeField(int index, intptr_t value) const;
3189 3189
3190 // Returns true if the instance is a closure object. 3190 // Returns true if the instance is a closure object.
3191 bool IsClosure() const; 3191 bool IsClosure() const;
3192 3192
3193 // If the instance is a callable object, i.e. a closure or the instance of a
3194 // class implementing a 'call' method, return true and set the function
3195 // (if not NULL) to call and the context (if not NULL) to pass.
srdjan 2012/12/14 18:13:13 to pass to the function.
regis 2012/12/14 18:49:49 Done.
3196 bool IsCallable(Function* function, Context* context) const;
3197
3193 static intptr_t InstanceSize() { 3198 static intptr_t InstanceSize() {
3194 return RoundedAllocationSize(sizeof(RawInstance)); 3199 return RoundedAllocationSize(sizeof(RawInstance));
3195 } 3200 }
3196 3201
3197 static RawInstance* New(const Class& cls, Heap::Space space = Heap::kNew); 3202 static RawInstance* New(const Class& cls, Heap::Space space = Heap::kNew);
3198 3203
3199 private: 3204 private:
3200 RawObject** FieldAddrAtOffset(intptr_t offset) const { 3205 RawObject** FieldAddrAtOffset(intptr_t offset) const {
3201 ASSERT(IsValidFieldOffset(offset)); 3206 ASSERT(IsValidFieldOffset(offset));
3202 return reinterpret_cast<RawObject**>(raw_value() - kHeapObjectTag + offset); 3207 return reinterpret_cast<RawObject**>(raw_value() - kHeapObjectTag + offset);
(...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after
6168 6173
6169 6174
6170 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6175 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6171 intptr_t index) { 6176 intptr_t index) {
6172 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6177 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6173 } 6178 }
6174 6179
6175 } // namespace dart 6180 } // namespace dart
6176 6181
6177 #endif // VM_OBJECT_H_ 6182 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698