| 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 2791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2802 Assembler _assembler_; | 2802 Assembler _assembler_; |
| 2803 GenerateIncrement(&_assembler_); | 2803 GenerateIncrement(&_assembler_); |
| 2804 Code& code = Code::Handle(Code::FinalizeCode( | 2804 Code& code = Code::Handle(Code::FinalizeCode( |
| 2805 Function::Handle(CreateFunction("Test_Code")), &_assembler_)); | 2805 Function::Handle(CreateFunction("Test_Code")), &_assembler_)); |
| 2806 code.set_exception_handlers(exception_handlers); | 2806 code.set_exception_handlers(exception_handlers); |
| 2807 | 2807 |
| 2808 // Verify the exception handler table entries by accessing them. | 2808 // Verify the exception handler table entries by accessing them. |
| 2809 const ExceptionHandlers& handlers = | 2809 const ExceptionHandlers& handlers = |
| 2810 ExceptionHandlers::Handle(code.exception_handlers()); | 2810 ExceptionHandlers::Handle(code.exception_handlers()); |
| 2811 EXPECT_EQ(kNumEntries, handlers.num_entries()); | 2811 EXPECT_EQ(kNumEntries, handlers.num_entries()); |
| 2812 RawExceptionHandlers::HandlerInfo info; | 2812 HandlerInfo info; |
| 2813 handlers.GetHandlerInfo(0, &info); | 2813 handlers.GetHandlerInfo(0, &info); |
| 2814 EXPECT_EQ(-1, handlers.OuterTryIndex(0)); | 2814 EXPECT_EQ(-1, handlers.OuterTryIndex(0)); |
| 2815 EXPECT_EQ(-1, info.outer_try_index); | 2815 EXPECT_EQ(-1, info.outer_try_index); |
| 2816 EXPECT_EQ(20u, handlers.HandlerPCOffset(0)); | 2816 EXPECT_EQ(20u, handlers.HandlerPCOffset(0)); |
| 2817 EXPECT(handlers.NeedsStackTrace(0)); | 2817 EXPECT(handlers.NeedsStackTrace(0)); |
| 2818 EXPECT(!handlers.HasCatchAll(0)); | 2818 EXPECT(!handlers.HasCatchAll(0)); |
| 2819 EXPECT_EQ(20u, info.handler_pc_offset); | 2819 EXPECT_EQ(20u, info.handler_pc_offset); |
| 2820 EXPECT_EQ(1, handlers.OuterTryIndex(3)); | 2820 EXPECT_EQ(1, handlers.OuterTryIndex(3)); |
| 2821 EXPECT_EQ(150u, handlers.HandlerPCOffset(3)); | 2821 EXPECT_EQ(150u, handlers.HandlerPCOffset(3)); |
| 2822 EXPECT(!handlers.NeedsStackTrace(3)); | 2822 EXPECT(!handlers.NeedsStackTrace(3)); |
| (...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4695 // utf32->utf16 conversion. | 4695 // utf32->utf16 conversion. |
| 4696 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, | 4696 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, |
| 4697 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; | 4697 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; |
| 4698 | 4698 |
| 4699 const String& str = | 4699 const String& str = |
| 4700 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); | 4700 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); |
| 4701 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); | 4701 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); |
| 4702 } | 4702 } |
| 4703 | 4703 |
| 4704 } // namespace dart | 4704 } // namespace dart |
| OLD | NEW |