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

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

Issue 9523001: Teach the flow graph compiler to play nice with the debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
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/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 __ LoadObject(RBX, function); 141 __ LoadObject(RBX, function);
142 __ pushq(RBX); 142 __ pushq(RBX);
143 GenerateCallRuntime(AstNode::kNoId, 143 GenerateCallRuntime(AstNode::kNoId,
144 0, 144 0,
145 kTraceFunctionExitRuntimeEntry); 145 kTraceFunctionExitRuntimeEntry);
146 __ popq(RAX); // Remove argument. 146 __ popq(RAX); // Remove argument.
147 __ popq(RAX); // Restore result. 147 __ popq(RAX); // Restore result.
148 } 148 }
149 __ LeaveFrame(); 149 __ LeaveFrame();
150 __ ret(); 150 __ ret();
151
152 // Generate 8 bytes of NOPs so that the debugger can patch the
153 // return pattern with a call to the debug stub.
srdjan 2012/02/28 21:37:40 __ nop(8) instead ?
hausner 2012/02/28 21:42:34 With 8 0x90 bytes it's easier to find the code pat
srdjan 2012/02/28 21:51:48 You may want to add a comment that the pattern of
154 __ nop(1);
155 __ nop(1);
156 __ nop(1);
157 __ nop(1);
158 __ nop(1);
159 __ nop(1);
160 __ nop(1);
161 __ nop(1);
162 AddCurrentDescriptor(PcDescriptors::kReturn,
163 AstNode::kNoId,
164 instr->token_index());
151 } 165 }
152 166
153 167
154 void FlowGraphCompiler::VisitBranch(BranchInstr* instr) { 168 void FlowGraphCompiler::VisitBranch(BranchInstr* instr) {
155 Bailout("BranchInstr"); 169 Bailout("BranchInstr");
156 } 170 }
157 171
158 172
159 void FlowGraphCompiler::CompileGraph() { 173 void FlowGraphCompiler::CompileGraph() {
160 const Function& function = parsed_function_.function(); 174 const Function& function = parsed_function_.function();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { 297 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) {
284 // We don't compile exception handlers yet. 298 // We don't compile exception handlers yet.
285 code.set_exception_handlers( 299 code.set_exception_handlers(
286 ExceptionHandlers::Handle(ExceptionHandlers::New(0))); 300 ExceptionHandlers::Handle(ExceptionHandlers::New(0)));
287 } 301 }
288 302
289 303
290 } // namespace dart 304 } // namespace dart
291 305
292 #endif // defined TARGET_ARCH_X64 306 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698