| OLD | NEW |
| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/compiler_stats.h" |
| 10 #include "vm/longjump.h" | 11 #include "vm/longjump.h" |
| 11 | 12 |
| 12 namespace dart { | 13 namespace dart { |
| 13 | 14 |
| 15 DECLARE_FLAG(bool, compiler_stats); |
| 16 |
| 14 void FlowGraphCompiler::Bailout(const char* reason) { | 17 void FlowGraphCompiler::Bailout(const char* reason) { |
| 15 const char* kFormat = "FlowGraphCompiler Bailout: %s."; | 18 const char* kFormat = "FlowGraphCompiler Bailout: %s."; |
| 16 intptr_t len = OS::SNPrint(NULL, 0, kFormat, reason) + 1; | 19 intptr_t len = OS::SNPrint(NULL, 0, kFormat, reason) + 1; |
| 17 char* chars = reinterpret_cast<char*>( | 20 char* chars = reinterpret_cast<char*>( |
| 18 Isolate::Current()->current_zone()->Allocate(len)); | 21 Isolate::Current()->current_zone()->Allocate(len)); |
| 19 OS::SNPrint(chars, len, kFormat, reason); | 22 OS::SNPrint(chars, len, kFormat, reason); |
| 20 const Error& error = Error::Handle( | 23 const Error& error = Error::Handle( |
| 21 LanguageError::New(String::Handle(String::New(chars)))); | 24 LanguageError::New(String::Handle(String::New(chars)))); |
| 22 Isolate::Current()->long_jump_base()->Jump(1, error); | 25 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 23 } | 26 } |
| 24 | 27 |
| 25 | 28 |
| 26 void FlowGraphCompiler::CompileGraph() { | 29 void FlowGraphCompiler::CompileGraph() { |
| 30 TimerScope timer(FLAG_compiler_stats, &CompilerStats::graphcompiler_timer); |
| 27 Bailout("CompileGraph"); | 31 Bailout("CompileGraph"); |
| 28 } | 32 } |
| 29 | 33 |
| 30 | 34 |
| 31 void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) { | 35 void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) { |
| 32 UNIMPLEMENTED(); | 36 UNIMPLEMENTED(); |
| 33 } | 37 } |
| 34 | 38 |
| 35 | 39 |
| 40 void FlowGraphCompiler::FinalizeStackmaps(const Code& code) { |
| 41 UNIMPLEMENTED(); |
| 42 } |
| 43 |
| 44 |
| 36 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { | 45 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { |
| 37 UNIMPLEMENTED(); | 46 UNIMPLEMENTED(); |
| 38 } | 47 } |
| 39 | 48 |
| 40 | 49 |
| 41 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { | 50 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { |
| 42 UNIMPLEMENTED(); | 51 UNIMPLEMENTED(); |
| 43 } | 52 } |
| 44 | 53 |
| 45 | 54 |
| 46 } // namespace dart | 55 } // namespace dart |
| 47 | 56 |
| 48 #endif // defined TARGET_ARCH_IA32 | 57 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |