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

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

Powered by Google App Engine
This is Rietveld 408576698