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

Side by Side Diff: runtime/vm/object.h

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 #ifndef RUNTIME_VM_OBJECT_H_ 5 #ifndef RUNTIME_VM_OBJECT_H_
6 #define RUNTIME_VM_OBJECT_H_ 6 #define RUNTIME_VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 4494 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 public: 4505 public:
4506 static const intptr_t kInvalidPcOffset = 0; 4506 static const intptr_t kInvalidPcOffset = 0;
4507 4507
4508 intptr_t num_entries() const; 4508 intptr_t num_entries() const;
4509 4509
4510 void GetHandlerInfo(intptr_t try_index, ExceptionHandlerInfo* info) const; 4510 void GetHandlerInfo(intptr_t try_index, ExceptionHandlerInfo* info) const;
4511 4511
4512 uword HandlerPCOffset(intptr_t try_index) const; 4512 uword HandlerPCOffset(intptr_t try_index) const;
4513 intptr_t OuterTryIndex(intptr_t try_index) const; 4513 intptr_t OuterTryIndex(intptr_t try_index) const;
4514 bool NeedsStackTrace(intptr_t try_index) const; 4514 bool NeedsStackTrace(intptr_t try_index) const;
4515 bool IsGenerated(intptr_t try_index) const;
4515 4516
4516 void SetHandlerInfo(intptr_t try_index, 4517 void SetHandlerInfo(intptr_t try_index,
4517 intptr_t outer_try_index, 4518 intptr_t outer_try_index,
4518 uword handler_pc_offset, 4519 uword handler_pc_offset,
4519 bool needs_stacktrace, 4520 bool needs_stacktrace,
4520 bool has_catch_all) const; 4521 bool has_catch_all,
4522 TokenPosition token_pos,
4523 bool is_generated) const;
4521 4524
4522 RawArray* GetHandledTypes(intptr_t try_index) const; 4525 RawArray* GetHandledTypes(intptr_t try_index) const;
4523 void SetHandledTypes(intptr_t try_index, const Array& handled_types) const; 4526 void SetHandledTypes(intptr_t try_index, const Array& handled_types) const;
4524 bool HasCatchAll(intptr_t try_index) const; 4527 bool HasCatchAll(intptr_t try_index) const;
4525 4528
4526 static intptr_t InstanceSize() { 4529 static intptr_t InstanceSize() {
4527 ASSERT(sizeof(RawExceptionHandlers) == 4530 ASSERT(sizeof(RawExceptionHandlers) ==
4528 OFFSET_OF_RETURNED_VALUE(RawExceptionHandlers, data)); 4531 OFFSET_OF_RETURNED_VALUE(RawExceptionHandlers, data));
4529 return 0; 4532 return 0;
4530 } 4533 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
4674 4677
4675 RawCodeSourceMap* code_source_map() const { 4678 RawCodeSourceMap* code_source_map() const {
4676 return raw_ptr()->code_source_map_; 4679 return raw_ptr()->code_source_map_;
4677 } 4680 }
4678 4681
4679 void set_code_source_map(const CodeSourceMap& code_source_map) const { 4682 void set_code_source_map(const CodeSourceMap& code_source_map) const {
4680 ASSERT(code_source_map.IsOld()); 4683 ASSERT(code_source_map.IsOld());
4681 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw()); 4684 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw());
4682 } 4685 }
4683 4686
4687 RawArray* await_token_positions() const {
4688 #if defined(DART_PRECOMPILED_RUNTIME)
4689 return Array::null();
4690 #else
4691 return raw_ptr()->await_token_positions_;
4692 #endif
4693 }
4694
4695 void SetAwaitTokenPositions(const Array& await_token_positions) const;
4696
4684 // Used during reloading (see object_reload.cc). Calls Reset on all ICDatas 4697 // Used during reloading (see object_reload.cc). Calls Reset on all ICDatas
4685 // that are embedded inside the Code object. 4698 // that are embedded inside the Code object.
4686 void ResetICDatas(Zone* zone) const; 4699 void ResetICDatas(Zone* zone) const;
4687 4700
4688 // Array of DeoptInfo objects. 4701 // Array of DeoptInfo objects.
4689 RawArray* deopt_info_array() const { 4702 RawArray* deopt_info_array() const {
4690 #if defined(DART_PRECOMPILED_RUNTIME) 4703 #if defined(DART_PRECOMPILED_RUNTIME)
4691 UNREACHABLE(); 4704 UNREACHABLE();
4692 return NULL; 4705 return NULL;
4693 #else 4706 #else
(...skipping 4223 matching lines...) Expand 10 before | Expand all | Expand 10 after
8917 8930
8918 inline void TypeArguments::SetHash(intptr_t value) const { 8931 inline void TypeArguments::SetHash(intptr_t value) const {
8919 // This is only safe because we create a new Smi, which does not cause 8932 // This is only safe because we create a new Smi, which does not cause
8920 // heap allocation. 8933 // heap allocation.
8921 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8934 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8922 } 8935 }
8923 8936
8924 } // namespace dart 8937 } // namespace dart
8925 8938
8926 #endif // RUNTIME_VM_OBJECT_H_ 8939 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698