| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2737 intptr_t token_index) { | 2737 intptr_t token_index) { |
| 2738 pc_descriptors_list_->AddDescriptor(kind, | 2738 pc_descriptors_list_->AddDescriptor(kind, |
| 2739 assembler_->CodeSize(), | 2739 assembler_->CodeSize(), |
| 2740 node_id, | 2740 node_id, |
| 2741 token_index, | 2741 token_index, |
| 2742 state()->try_index()); | 2742 state()->try_index()); |
| 2743 } | 2743 } |
| 2744 | 2744 |
| 2745 | 2745 |
| 2746 void CodeGenerator::ErrorMsg(intptr_t token_index, const char* format, ...) { | 2746 void CodeGenerator::ErrorMsg(intptr_t token_index, const char* format, ...) { |
| 2747 char error_msg[Parser::kErrorBuflen]; | 2747 const intptr_t kMessageBufferSize = 512; |
| 2748 char message_buffer[kMessageBufferSize]; |
| 2748 va_list args; | 2749 va_list args; |
| 2749 va_start(args, format); | 2750 va_start(args, format); |
| 2750 const Class& cls = Class::Handle(parsed_function_.function().owner()); | 2751 const Class& cls = Class::Handle(parsed_function_.function().owner()); |
| 2751 const Script& script = Script::Handle(cls.script()); | 2752 const Script& script = Script::Handle(cls.script()); |
| 2752 Parser::ReportMsg(script, token_index, "Error", error_msg, format, args); | 2753 Parser::FormatMessage(script, token_index, "Error", |
| 2753 Isolate::Current()->long_jump_base()->Jump(1, error_msg); | 2754 message_buffer, kMessageBufferSize, |
| 2755 format, args); |
| 2756 va_end(args); |
| 2757 Isolate::Current()->long_jump_base()->Jump(1, message_buffer); |
| 2754 UNREACHABLE(); | 2758 UNREACHABLE(); |
| 2755 } | 2759 } |
| 2756 | 2760 |
| 2757 } // namespace dart | 2761 } // namespace dart |
| 2758 | 2762 |
| 2759 #endif // defined TARGET_ARCH_IA32 | 2763 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |