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