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

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

Issue 14298012: Fix for issue 9871 - Object::empty_array() returns a broken handle. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 4816 matching lines...) Expand 10 before | Expand all | Expand 10 after
4827 } 4827 }
4828 4828
4829 void SetLength(intptr_t value) const { 4829 void SetLength(intptr_t value) const {
4830 // This is only safe because we create a new Smi, which does not cause 4830 // This is only safe because we create a new Smi, which does not cause
4831 // heap allocation. 4831 // heap allocation.
4832 raw_ptr()->length_ = Smi::New(value); 4832 raw_ptr()->length_ = Smi::New(value);
4833 } 4833 }
4834 4834
4835 HEAP_OBJECT_IMPLEMENTATION(Array, Instance); 4835 HEAP_OBJECT_IMPLEMENTATION(Array, Instance);
4836 friend class Class; 4836 friend class Class;
4837 friend class Object;
4837 friend class String; 4838 friend class String;
4838 }; 4839 };
4839 4840
4840 4841
4841 class ImmutableArray : public Array { 4842 class ImmutableArray : public Array {
4842 public: 4843 public:
4843 static RawImmutableArray* New(intptr_t len, Heap::Space space = Heap::kNew); 4844 static RawImmutableArray* New(intptr_t len, Heap::Space space = Heap::kNew);
4844 4845
4845 private: 4846 private:
4846 FINAL_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray, Array); 4847 FINAL_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray, Array);
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
5657 5658
5658 5659
5659 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 5660 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
5660 intptr_t index) { 5661 intptr_t index) {
5661 return array.At((index * kEntryLength) + kTargetFunctionIndex); 5662 return array.At((index * kEntryLength) + kTargetFunctionIndex);
5662 } 5663 }
5663 5664
5664 } // namespace dart 5665 } // namespace dart
5665 5666
5666 #endif // VM_OBJECT_H_ 5667 #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