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

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

Issue 254483005: - Rationalize the way we use comments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « runtime/vm/object.cc ('k') | runtime/vm/stub_code_arm.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 #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 "platform/globals.h" 8 #include "platform/globals.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/disassembler.h" 10 #include "vm/disassembler.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 Code& stub = Code::Handle(isolate, cls.allocation_stub()); 103 Code& stub = Code::Handle(isolate, cls.allocation_stub());
104 if (stub.IsNull()) { 104 if (stub.IsNull()) {
105 Assembler assembler; 105 Assembler assembler;
106 const char* name = cls.ToCString(); 106 const char* name = cls.ToCString();
107 StubCode::GenerateAllocationStubForClass(&assembler, cls); 107 StubCode::GenerateAllocationStubForClass(&assembler, cls);
108 stub ^= Code::FinalizeCode(name, &assembler); 108 stub ^= Code::FinalizeCode(name, &assembler);
109 stub.set_owner(cls); 109 stub.set_owner(cls);
110 cls.set_allocation_stub(stub); 110 cls.set_allocation_stub(stub);
111 if (FLAG_disassemble_stubs) { 111 if (FLAG_disassemble_stubs) {
112 OS::Print("Code for allocation stub '%s': {\n", name); 112 OS::Print("Code for allocation stub '%s': {\n", name);
113 Disassembler::Disassemble(stub.EntryPoint(), 113 DisassembleToStdout formatter;
114 stub.EntryPoint() + assembler.CodeSize()); 114 stub.Disassemble(&formatter);
115 OS::Print("}\n"); 115 OS::Print("}\n");
116 } 116 }
117 } 117 }
118 return stub.raw(); 118 return stub.raw();
119 } 119 }
120 120
121 121
122 RawCode* StubCode::Generate(const char* name, 122 RawCode* StubCode::Generate(const char* name,
123 void (*GenerateStub)(Assembler* assembler)) { 123 void (*GenerateStub)(Assembler* assembler)) {
124 Assembler assembler; 124 Assembler assembler;
125 GenerateStub(&assembler); 125 GenerateStub(&assembler);
126 const Code& code = Code::Handle(Code::FinalizeCode(name, &assembler)); 126 const Code& code = Code::Handle(Code::FinalizeCode(name, &assembler));
127 if (FLAG_disassemble_stubs) { 127 if (FLAG_disassemble_stubs) {
128 OS::Print("Code for stub '%s': {\n", name); 128 OS::Print("Code for stub '%s': {\n", name);
129 Disassembler::Disassemble(code.EntryPoint(), 129 DisassembleToStdout formatter;
130 code.EntryPoint() + assembler.CodeSize()); 130 code.Disassemble(&formatter);
131 OS::Print("}\n"); 131 OS::Print("}\n");
132 } 132 }
133 return code.raw(); 133 return code.raw();
134 } 134 }
135 135
136 136
137 const char* StubCode::NameOfStub(uword entry_point) { 137 const char* StubCode::NameOfStub(uword entry_point) {
138 #define STUB_CODE_TESTER(name) \ 138 #define STUB_CODE_TESTER(name) \
139 if ((name##_entry() != NULL) && (entry_point == name##EntryPoint())) { \ 139 if ((name##_entry() != NULL) && (entry_point == name##EntryPoint())) { \
140 return ""#name; \ 140 return ""#name; \
141 } 141 }
142 142
143 VM_STUB_CODE_LIST(STUB_CODE_TESTER); 143 VM_STUB_CODE_LIST(STUB_CODE_TESTER);
144 Isolate* isolate = Isolate::Current(); 144 Isolate* isolate = Isolate::Current();
145 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { 145 if ((isolate != NULL) && (isolate->stub_code() != NULL)) {
146 STUB_CODE_LIST(STUB_CODE_TESTER); 146 STUB_CODE_LIST(STUB_CODE_TESTER);
147 } 147 }
148 #undef STUB_CODE_TESTER 148 #undef STUB_CODE_TESTER
149 return NULL; 149 return NULL;
150 } 150 }
151 151
152 } // namespace dart 152 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698