OLD | NEW |
---|---|
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/cha.h" | 9 #include "vm/cha.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 EmitInstructionEpilogue(instr); | 276 EmitInstructionEpilogue(instr); |
277 } | 277 } |
278 } | 278 } |
279 } | 279 } |
280 set_current_block(NULL); | 280 set_current_block(NULL); |
281 } | 281 } |
282 | 282 |
283 | 283 |
284 void FlowGraphCompiler::Bailout(const char* reason) { | 284 void FlowGraphCompiler::Bailout(const char* reason) { |
285 const char* kFormat = "FlowGraphCompiler Bailout: %s %s."; | 285 const char* kFormat = "FlowGraphCompiler Bailout: %s %s."; |
286 const char* function_name = parsed_function().function().ToCString(); | 286 const Function& function = parsed_function_.function(); |
287 const char* function_name = function.ToCString(); | |
287 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 288 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
288 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 289 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
289 OS::SNPrint(chars, len, kFormat, function_name, reason); | 290 OS::SNPrint(chars, len, kFormat, function_name, reason); |
290 const Error& error = Error::Handle( | 291 const Error& error = Error::Handle( |
291 LanguageError::New(String::Handle(String::New(chars)))); | 292 LanguageError::New(Error::Handle(), // No previous error. |
293 Script::Handle(function.script()), | |
294 function.token_pos(), | |
295 LanguageError::kError, | |
296 String::Handle(String::New(chars)))); | |
Ivan Posva
2013/11/15 04:42:13
ditto
regis
2013/11/15 18:27:38
Done.
| |
292 Isolate::Current()->long_jump_base()->Jump(1, error); | 297 Isolate::Current()->long_jump_base()->Jump(1, error); |
293 } | 298 } |
294 | 299 |
295 | 300 |
296 intptr_t FlowGraphCompiler::StackSize() const { | 301 intptr_t FlowGraphCompiler::StackSize() const { |
297 if (is_optimizing_) { | 302 if (is_optimizing_) { |
298 return flow_graph_.graph_entry()->spill_slot_count(); | 303 return flow_graph_.graph_entry()->spill_slot_count(); |
299 } else { | 304 } else { |
300 return parsed_function_.num_stack_locals() + | 305 return parsed_function_.num_stack_locals() + |
301 parsed_function_.num_copied_params(); | 306 parsed_function_.num_copied_params(); |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1214 | 1219 |
1215 for (int i = 0; i < len; i++) { | 1220 for (int i = 0; i < len; i++) { |
1216 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), | 1221 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), |
1217 &Function::ZoneHandle(ic_data.GetTargetAt(i)), | 1222 &Function::ZoneHandle(ic_data.GetTargetAt(i)), |
1218 ic_data.GetCountAt(i))); | 1223 ic_data.GetCountAt(i))); |
1219 } | 1224 } |
1220 sorted->Sort(HighestCountFirst); | 1225 sorted->Sort(HighestCountFirst); |
1221 } | 1226 } |
1222 | 1227 |
1223 } // namespace dart | 1228 } // namespace dart |
OLD | NEW |