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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 3952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3963 ASSERT(found); | 3963 ASSERT(found); |
3964 } | 3964 } |
3965 | 3965 |
3966 | 3966 |
3967 void FlowGraphBuilder::Warning(intptr_t token_pos, | 3967 void FlowGraphBuilder::Warning(intptr_t token_pos, |
3968 const char* format, ...) const { | 3968 const char* format, ...) const { |
3969 if (FLAG_silent_warnings) return; | 3969 if (FLAG_silent_warnings) return; |
3970 const Function& function = parsed_function_->function(); | 3970 const Function& function = parsed_function_->function(); |
3971 va_list args; | 3971 va_list args; |
3972 va_start(args, format); | 3972 va_start(args, format); |
| 3973 const Script& script = Script::Handle(I, function.script()); |
3973 const Error& error = Error::Handle( | 3974 const Error& error = Error::Handle( |
3974 I, | 3975 I, |
3975 LanguageError::NewFormattedV( | 3976 LanguageError::NewFormattedV( |
3976 Error::Handle(I, Error::null()), // No previous error. | 3977 Error::Handle(I, Error::null()), // No previous error. |
3977 Script::Handle(I, function.script()), | 3978 script, token_pos, LanguageError::kWarning, |
3978 token_pos, LanguageError::kWarning, | |
3979 Heap::kNew, format, args)); | 3979 Heap::kNew, format, args)); |
3980 va_end(args); | 3980 va_end(args); |
3981 if (FLAG_warning_as_error) { | 3981 if (FLAG_warning_as_error) { |
3982 I->long_jump_base()->Jump(1, error); | 3982 I->long_jump_base()->Jump(1, error); |
3983 UNREACHABLE(); | 3983 UNREACHABLE(); |
3984 } else { | 3984 } else { |
3985 OS::Print("%s", error.ToErrorCString()); | 3985 OS::Print("%s", error.ToErrorCString()); |
| 3986 va_start(args, format); |
| 3987 TraceBuffer::TraceWarningV(I, script, token_pos, format, args); |
| 3988 va_end(args); |
3986 } | 3989 } |
3987 } | 3990 } |
3988 | 3991 |
3989 | 3992 |
3990 void FlowGraphBuilder::Bailout(const char* reason) const { | 3993 void FlowGraphBuilder::Bailout(const char* reason) const { |
3991 const Function& function = parsed_function_->function(); | 3994 const Function& function = parsed_function_->function(); |
3992 const Error& error = Error::Handle( | 3995 const Error& error = Error::Handle( |
3993 I, | 3996 I, |
3994 LanguageError::NewFormatted( | 3997 LanguageError::NewFormatted( |
3995 Error::Handle(I, Error::null()), // No previous error. | 3998 Error::Handle(I, Error::null()), // No previous error. |
3996 Script::Handle(I, function.script()), | 3999 Script::Handle(I, function.script()), |
3997 function.token_pos(), | 4000 function.token_pos(), |
3998 LanguageError::kBailout, | 4001 LanguageError::kBailout, |
3999 Heap::kNew, | 4002 Heap::kNew, |
4000 "FlowGraphBuilder Bailout: %s %s", | 4003 "FlowGraphBuilder Bailout: %s %s", |
4001 String::Handle(I, function.name()).ToCString(), | 4004 String::Handle(I, function.name()).ToCString(), |
4002 reason)); | 4005 reason)); |
4003 I->long_jump_base()->Jump(1, error); | 4006 I->long_jump_base()->Jump(1, error); |
4004 UNREACHABLE(); | 4007 UNREACHABLE(); |
4005 } | 4008 } |
4006 | 4009 |
4007 } // namespace dart | 4010 } // namespace dart |
OLD | NEW |