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

Side by Side Diff: runtime/vm/stub_code.cc

Issue 182703003: Cleanup native, collected, and stub code handling in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « runtime/vm/stack_frame.cc ('k') | runtime/vm/symbols.h » ('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 #include "vm/stub_code.h" 5 #include "vm/stub_code.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/disassembler.h" 9 #include "vm/disassembler.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { 98 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) {
99 Isolate* isolate = Isolate::Current(); 99 Isolate* isolate = Isolate::Current();
100 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); 100 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate));
101 ASSERT(error.IsNull()); 101 ASSERT(error.IsNull());
102 Code& stub = Code::Handle(isolate, cls.allocation_stub()); 102 Code& stub = Code::Handle(isolate, cls.allocation_stub());
103 if (stub.IsNull()) { 103 if (stub.IsNull()) {
104 Assembler assembler; 104 Assembler assembler;
105 const char* name = cls.ToCString(); 105 const char* name = cls.ToCString();
106 StubCode::GenerateAllocationStubForClass(&assembler, cls); 106 StubCode::GenerateAllocationStubForClass(&assembler, cls);
107 stub ^= Code::FinalizeCode(name, &assembler); 107 stub ^= Code::FinalizeCode(name, &assembler);
108 stub.set_owner(cls);
108 cls.set_allocation_stub(stub); 109 cls.set_allocation_stub(stub);
109 if (FLAG_disassemble_stubs) { 110 if (FLAG_disassemble_stubs) {
110 OS::Print("Code for allocation stub '%s': {\n", name); 111 OS::Print("Code for allocation stub '%s': {\n", name);
111 Disassembler::Disassemble(stub.EntryPoint(), 112 Disassembler::Disassemble(stub.EntryPoint(),
112 stub.EntryPoint() + assembler.CodeSize()); 113 stub.EntryPoint() + assembler.CodeSize());
113 OS::Print("}\n"); 114 OS::Print("}\n");
114 } 115 }
115 } 116 }
116 return stub.raw(); 117 return stub.raw();
117 } 118 }
(...skipping 23 matching lines...) Expand all
141 VM_STUB_CODE_LIST(STUB_CODE_TESTER); 142 VM_STUB_CODE_LIST(STUB_CODE_TESTER);
142 Isolate* isolate = Isolate::Current(); 143 Isolate* isolate = Isolate::Current();
143 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { 144 if ((isolate != NULL) && (isolate->stub_code() != NULL)) {
144 STUB_CODE_LIST(STUB_CODE_TESTER); 145 STUB_CODE_LIST(STUB_CODE_TESTER);
145 } 146 }
146 #undef STUB_CODE_TESTER 147 #undef STUB_CODE_TESTER
147 return NULL; 148 return NULL;
148 } 149 }
149 150
150 } // namespace dart 151 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/stack_frame.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698