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

Side by Side Diff: vm/object.h

Issue 10223015: Add a stub_code_space in the heap alongside code_space so that stub code generation happens here an… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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
« vm/heap.cc ('K') | « vm/heap.cc ('k') | 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 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1935 raw_ptr()->size_ = size; 1935 raw_ptr()->size_ = size;
1936 } 1936 }
1937 void set_code(RawCode* code) { 1937 void set_code(RawCode* code) {
1938 raw_ptr()->code_ = code; 1938 raw_ptr()->code_ = code;
1939 } 1939 }
1940 1940
1941 // New is a private method as RawInstruction and RawCode objects should 1941 // New is a private method as RawInstruction and RawCode objects should
1942 // only be created using the Code::FinalizeCode method. This method creates 1942 // only be created using the Code::FinalizeCode method. This method creates
1943 // the RawInstruction and RawCode objects, sets up the pointer offsets 1943 // the RawInstruction and RawCode objects, sets up the pointer offsets
1944 // and links the two in a GC safe manner. 1944 // and links the two in a GC safe manner.
1945 static RawInstructions* New(intptr_t size); 1945 static RawInstructions* New(intptr_t size, Heap::Space space);
1946 1946
1947 HEAP_OBJECT_IMPLEMENTATION(Instructions, Object); 1947 HEAP_OBJECT_IMPLEMENTATION(Instructions, Object);
1948 friend class Code; 1948 friend class Code;
1949 friend class Class; 1949 friend class Class;
1950 }; 1950 };
1951 1951
1952 1952
1953 class LocalVarDescriptors : public Object { 1953 class LocalVarDescriptors : public Object {
1954 public: 1954 public:
1955 intptr_t Length() const; 1955 intptr_t Length() const;
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 2241
2242 static intptr_t InstanceSize() { 2242 static intptr_t InstanceSize() {
2243 ASSERT(sizeof(RawCode) == OFFSET_OF(RawCode, data_)); 2243 ASSERT(sizeof(RawCode) == OFFSET_OF(RawCode, data_));
2244 return 0; 2244 return 0;
2245 } 2245 }
2246 static intptr_t InstanceSize(intptr_t pointer_offsets_length) { 2246 static intptr_t InstanceSize(intptr_t pointer_offsets_length) {
2247 return RoundedAllocationSize( 2247 return RoundedAllocationSize(
2248 sizeof(RawCode) + (pointer_offsets_length * kEntrySize)); 2248 sizeof(RawCode) + (pointer_offsets_length * kEntrySize));
2249 } 2249 }
2250 static RawCode* FinalizeCode(const char* name, Assembler* assembler); 2250 static RawCode* FinalizeCode(const char* name, Assembler* assembler);
2251 static RawCode* FinalizeStubCode(const char* name, Assembler* assembler);
2251 2252
2252 int32_t GetPointerOffsetAt(int index) const { 2253 int32_t GetPointerOffsetAt(int index) const {
2253 return *PointerOffsetAddrAt(index); 2254 return *PointerOffsetAddrAt(index);
2254 } 2255 }
2255 intptr_t GetTokenIndexOfPC(uword pc) const; 2256 intptr_t GetTokenIndexOfPC(uword pc) const;
2256 2257
2257 // Find pc of patch code buffer. Return 0 if not found. 2258 // Find pc of patch code buffer. Return 0 if not found.
2258 uword GetPatchCodePc() const; 2259 uword GetPatchCodePc() const;
2259 2260
2260 uword GetDeoptPcAtNodeId(intptr_t node_id) const; 2261 uword GetDeoptPcAtNodeId(intptr_t node_id) const;
(...skipping 27 matching lines...) Expand all
2288 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) { 2289 void SetPointerOffsetAt(int index, int32_t offset_in_instructions) {
2289 *PointerOffsetAddrAt(index) = offset_in_instructions; 2290 *PointerOffsetAddrAt(index) = offset_in_instructions;
2290 } 2291 }
2291 2292
2292 // New is a private method as RawInstruction and RawCode objects should 2293 // New is a private method as RawInstruction and RawCode objects should
2293 // only be created using the Code::FinalizeCode method. This method creates 2294 // only be created using the Code::FinalizeCode method. This method creates
2294 // the RawInstruction and RawCode objects, sets up the pointer offsets 2295 // the RawInstruction and RawCode objects, sets up the pointer offsets
2295 // and links the two in a GC safe manner. 2296 // and links the two in a GC safe manner.
2296 static RawCode* New(int pointer_offsets_length); 2297 static RawCode* New(int pointer_offsets_length);
2297 2298
2299 static RawCode* FinalizeCode(const char* name,
2300 Assembler* assembler,
2301 Heap::Space space);
2302
2298 HEAP_OBJECT_IMPLEMENTATION(Code, Object); 2303 HEAP_OBJECT_IMPLEMENTATION(Code, Object);
2299 friend class Class; 2304 friend class Class;
2300 }; 2305 };
2301 2306
2302 2307
2303 class Context : public Object { 2308 class Context : public Object {
2304 public: 2309 public:
2305 RawContext* parent() const { return raw_ptr()->parent_; } 2310 RawContext* parent() const { return raw_ptr()->parent_; }
2306 void set_parent(const Context& parent) const { 2311 void set_parent(const Context& parent) const {
2307 ASSERT(parent.IsNull() || parent.isolate() == Isolate::Current()); 2312 ASSERT(parent.IsNull() || parent.isolate() == Isolate::Current());
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
4000 } 4005 }
4001 4006
4002 4007
4003 intptr_t Stackmap::SizeInBits() const { 4008 intptr_t Stackmap::SizeInBits() const {
4004 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); 4009 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte);
4005 } 4010 }
4006 4011
4007 } // namespace dart 4012 } // namespace dart
4008 4013
4009 #endif // VM_OBJECT_H_ 4014 #endif // VM_OBJECT_H_
OLDNEW
« vm/heap.cc ('K') | « vm/heap.cc ('k') | vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698