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

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

Issue 1314143002: VM: Don't depend on unoptimized code when inlining and creating deoptimization info. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 3 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 EmitTrySync(instr, CurrentTryIndex()); 382 EmitTrySync(instr, CurrentTryIndex());
383 } 383 }
384 } 384 }
385 385
386 386
387 387
388 void FlowGraphCompiler::EmitSourceLine(Instruction* instr) { 388 void FlowGraphCompiler::EmitSourceLine(Instruction* instr) {
389 if ((instr->token_pos() == Scanner::kNoSourcePos) || (instr->env() == NULL)) { 389 if ((instr->token_pos() == Scanner::kNoSourcePos) || (instr->env() == NULL)) {
390 return; 390 return;
391 } 391 }
392 const Function& function = 392 const Script& script =
393 Function::Handle(instr->env()->code().function()); 393 Script::Handle(zone(), instr->env()->function().script());
394 const Script& s = Script::Handle(function.script());
395 intptr_t line_nr; 394 intptr_t line_nr;
396 intptr_t column_nr; 395 intptr_t column_nr;
397 s.GetTokenLocation(instr->token_pos(), &line_nr, &column_nr); 396 script.GetTokenLocation(instr->token_pos(), &line_nr, &column_nr);
398 const String& line = String::Handle(s.GetLine(line_nr)); 397 const String& line = String::Handle(zone(), script.GetLine(line_nr));
399 assembler()->Comment("Line %" Pd " in '%s':\n %s", 398 assembler()->Comment("Line %" Pd " in '%s':\n %s",
400 line_nr, function.ToFullyQualifiedCString(), line.ToCString()); 399 line_nr,
400 instr->env()->function().ToFullyQualifiedCString(),
401 line.ToCString());
401 } 402 }
402 403
403 404
404 static void LoopInfoComment( 405 static void LoopInfoComment(
405 Assembler* assembler, 406 Assembler* assembler,
406 const BlockEntryInstr& block, 407 const BlockEntryInstr& block,
407 const ZoneGrowableArray<BlockEntryInstr*>& loop_headers) { 408 const ZoneGrowableArray<BlockEntryInstr*>& loop_headers) {
408 if (Assembler::EmittingComments()) { 409 if (Assembler::EmittingComments()) {
409 for (intptr_t loop_id = 0; loop_id < loop_headers.length(); ++loop_id) { 410 for (intptr_t loop_id = 0; loop_id < loop_headers.length(); ++loop_id) {
410 for (BitVector::Iterator loop_it(loop_headers[loop_id]->loop_info()); 411 for (BitVector::Iterator loop_it(loop_headers[loop_id]->loop_info());
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 1823
1823 1824
1824 void FlowGraphCompiler::FrameStateClear() { 1825 void FlowGraphCompiler::FrameStateClear() {
1825 ASSERT(!is_optimizing()); 1826 ASSERT(!is_optimizing());
1826 frame_state_.TruncateTo(0); 1827 frame_state_.TruncateTo(0);
1827 } 1828 }
1828 #endif 1829 #endif
1829 1830
1830 1831
1831 } // namespace dart 1832 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698