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

Unified Diff: vm/object.cc

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, 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 side-by-side diff with in-line comments
Download patch
« vm/heap.cc ('K') | « vm/object.h ('k') | vm/stack_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 6972)
+++ vm/object.cc (working copy)
@@ -5483,14 +5483,13 @@
}
-RawInstructions* Instructions::New(intptr_t size) {
+RawInstructions* Instructions::New(intptr_t size, Heap::Space space) {
+ ASSERT(space == Heap::kDartCode || space == Heap::kStubCode);
const Class& instructions_class = Class::Handle(Object::instructions_class());
Instructions& result = Instructions::Handle();
{
uword aligned_size = Instructions::InstanceSize(size);
- RawObject* raw = Object::Allocate(instructions_class,
- aligned_size,
- Heap::kExecutable);
+ RawObject* raw = Object::Allocate(instructions_class, aligned_size, space);
NoGCScope no_gc;
result ^= raw;
result.set_size(size);
@@ -5911,12 +5910,14 @@
}
-RawCode* Code::FinalizeCode(const char* name, Assembler* assembler) {
+RawCode* Code::FinalizeCode(const char* name,
+ Assembler* assembler,
+ Heap::Space space) {
ASSERT(assembler != NULL);
// Allocate the Instructions object.
Instructions& instrs =
- Instructions::ZoneHandle(Instructions::New(assembler->CodeSize()));
+ Instructions::ZoneHandle(Instructions::New(assembler->CodeSize(), space));
// Copy the instructions into the instruction area and apply all fixups.
// Embedded pointers are still in handles at this point.
@@ -5978,6 +5979,16 @@
}
+RawCode* Code::FinalizeCode(const char* name, Assembler* assembler) {
+ return FinalizeCode(name, assembler, Heap::kDartCode);
+}
+
+
+RawCode* Code::FinalizeStubCode(const char* name, Assembler* assembler) {
+ return FinalizeCode(name, assembler, Heap::kStubCode);
+}
+
+
intptr_t Code::GetTokenIndexOfPC(uword pc) const {
intptr_t token_index = -1;
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
« vm/heap.cc ('K') | « vm/object.h ('k') | vm/stack_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698