| 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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2793 #endif // ARCH_IS_64_BIT | 2793 #endif // ARCH_IS_64_BIT |
| 2794 | 2794 |
| 2795 | 2795 |
| 2796 ISOLATE_UNIT_TEST_CASE(ExceptionHandlers) { | 2796 ISOLATE_UNIT_TEST_CASE(ExceptionHandlers) { |
| 2797 const int kNumEntries = 4; | 2797 const int kNumEntries = 4; |
| 2798 // Add an exception handler table to the code. | 2798 // Add an exception handler table to the code. |
| 2799 ExceptionHandlers& exception_handlers = ExceptionHandlers::Handle(); | 2799 ExceptionHandlers& exception_handlers = ExceptionHandlers::Handle(); |
| 2800 exception_handlers ^= ExceptionHandlers::New(kNumEntries); | 2800 exception_handlers ^= ExceptionHandlers::New(kNumEntries); |
| 2801 const bool kNeedsStackTrace = true; | 2801 const bool kNeedsStackTrace = true; |
| 2802 const bool kNoStackTrace = false; | 2802 const bool kNoStackTrace = false; |
| 2803 exception_handlers.SetHandlerInfo(0, -1, 20u, kNeedsStackTrace, false, | 2803 exception_handlers.SetHandlerInfo(0, -1, 20u, kNeedsStackTrace, false); |
| 2804 TokenPosition::kNoSource, true); | 2804 exception_handlers.SetHandlerInfo(1, 0, 30u, kNeedsStackTrace, false); |
| 2805 exception_handlers.SetHandlerInfo(1, 0, 30u, kNeedsStackTrace, false, | 2805 exception_handlers.SetHandlerInfo(2, -1, 40u, kNoStackTrace, true); |
| 2806 TokenPosition::kNoSource, true); | 2806 exception_handlers.SetHandlerInfo(3, 1, 150u, kNoStackTrace, true); |
| 2807 exception_handlers.SetHandlerInfo(2, -1, 40u, kNoStackTrace, true, | |
| 2808 TokenPosition::kNoSource, true); | |
| 2809 exception_handlers.SetHandlerInfo(3, 1, 150u, kNoStackTrace, true, | |
| 2810 TokenPosition::kNoSource, true); | |
| 2811 | 2807 |
| 2812 extern void GenerateIncrement(Assembler * assembler); | 2808 extern void GenerateIncrement(Assembler * assembler); |
| 2813 Assembler _assembler_; | 2809 Assembler _assembler_; |
| 2814 GenerateIncrement(&_assembler_); | 2810 GenerateIncrement(&_assembler_); |
| 2815 Code& code = Code::Handle(Code::FinalizeCode( | 2811 Code& code = Code::Handle(Code::FinalizeCode( |
| 2816 Function::Handle(CreateFunction("Test_Code")), &_assembler_)); | 2812 Function::Handle(CreateFunction("Test_Code")), &_assembler_)); |
| 2817 code.set_exception_handlers(exception_handlers); | 2813 code.set_exception_handlers(exception_handlers); |
| 2818 | 2814 |
| 2819 // Verify the exception handler table entries by accessing them. | 2815 // Verify the exception handler table entries by accessing them. |
| 2820 const ExceptionHandlers& handlers = | 2816 const ExceptionHandlers& handlers = |
| (...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4706 // utf32->utf16 conversion. | 4702 // utf32->utf16 conversion. |
| 4707 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, | 4703 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, |
| 4708 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; | 4704 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; |
| 4709 | 4705 |
| 4710 const String& str = | 4706 const String& str = |
| 4711 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); | 4707 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); |
| 4712 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); | 4708 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); |
| 4713 } | 4709 } |
| 4714 | 4710 |
| 4715 } // namespace dart | 4711 } // namespace dart |
| OLD | NEW |