Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1215)

Side by Side Diff: runtime/vm/object_test.cc

Issue 2692803006: Track the 'awaiter return' call stack use it to detect uncaught exceptions in async functions (Closed)
Patch Set: port to other architectures Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2786 #endif // ARCH_IS_64_BIT 2786 #endif // ARCH_IS_64_BIT
2787 2787
2788 2788
2789 ISOLATE_UNIT_TEST_CASE(ExceptionHandlers) { 2789 ISOLATE_UNIT_TEST_CASE(ExceptionHandlers) {
2790 const int kNumEntries = 4; 2790 const int kNumEntries = 4;
2791 // Add an exception handler table to the code. 2791 // Add an exception handler table to the code.
2792 ExceptionHandlers& exception_handlers = ExceptionHandlers::Handle(); 2792 ExceptionHandlers& exception_handlers = ExceptionHandlers::Handle();
2793 exception_handlers ^= ExceptionHandlers::New(kNumEntries); 2793 exception_handlers ^= ExceptionHandlers::New(kNumEntries);
2794 const bool kNeedsStackTrace = true; 2794 const bool kNeedsStackTrace = true;
2795 const bool kNoStackTrace = false; 2795 const bool kNoStackTrace = false;
2796 exception_handlers.SetHandlerInfo(0, -1, 20u, kNeedsStackTrace, false); 2796 exception_handlers.SetHandlerInfo(0, -1, 20u, kNeedsStackTrace, false,
2797 exception_handlers.SetHandlerInfo(1, 0, 30u, kNeedsStackTrace, false); 2797 TokenPosition::kNoSource, true);
2798 exception_handlers.SetHandlerInfo(2, -1, 40u, kNoStackTrace, true); 2798 exception_handlers.SetHandlerInfo(1, 0, 30u, kNeedsStackTrace, false,
2799 exception_handlers.SetHandlerInfo(3, 1, 150u, kNoStackTrace, true); 2799 TokenPosition::kNoSource, true);
2800 exception_handlers.SetHandlerInfo(2, -1, 40u, kNoStackTrace, true,
2801 TokenPosition::kNoSource, true);
2802 exception_handlers.SetHandlerInfo(3, 1, 150u, kNoStackTrace, true,
2803 TokenPosition::kNoSource, true);
2800 2804
2801 extern void GenerateIncrement(Assembler * assembler); 2805 extern void GenerateIncrement(Assembler * assembler);
2802 Assembler _assembler_; 2806 Assembler _assembler_;
2803 GenerateIncrement(&_assembler_); 2807 GenerateIncrement(&_assembler_);
2804 Code& code = Code::Handle(Code::FinalizeCode( 2808 Code& code = Code::Handle(Code::FinalizeCode(
2805 Function::Handle(CreateFunction("Test_Code")), &_assembler_)); 2809 Function::Handle(CreateFunction("Test_Code")), &_assembler_));
2806 code.set_exception_handlers(exception_handlers); 2810 code.set_exception_handlers(exception_handlers);
2807 2811
2808 // Verify the exception handler table entries by accessing them. 2812 // Verify the exception handler table entries by accessing them.
2809 const ExceptionHandlers& handlers = 2813 const ExceptionHandlers& handlers =
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after
4695 // utf32->utf16 conversion. 4699 // utf32->utf16 conversion.
4696 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, 4700 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff,
4697 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; 4701 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff};
4698 4702
4699 const String& str = 4703 const String& str =
4700 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); 4704 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes)));
4701 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); 4705 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes)));
4702 } 4706 }
4703 4707
4704 } // namespace dart 4708 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698