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

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

Issue 868103002: VM: Use PC offset instead of absolute PC in exception handler info. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 kRuntimeCall = kClosureCall << 1, // Runtime call. 1016 kRuntimeCall = kClosureCall << 1, // Runtime call.
1017 kOsrEntry = kRuntimeCall << 1, // OSR entry point in unopt. code. 1017 kOsrEntry = kRuntimeCall << 1, // OSR entry point in unopt. code.
1018 kOther = kOsrEntry << 1, 1018 kOther = kOsrEntry << 1,
1019 kAnyKind = 0xFF 1019 kAnyKind = 0xFF
1020 }; 1020 };
1021 1021
1022 // Compressed version assumes try_index is always -1 and does not store it. 1022 // Compressed version assumes try_index is always -1 and does not store it.
1023 struct PcDescriptorRec { 1023 struct PcDescriptorRec {
1024 uword pc_offset() const { return pc_offset_; } 1024 uword pc_offset() const { return pc_offset_; }
1025 void set_pc_offset(uword value) { 1025 void set_pc_offset(uword value) {
1026 #if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64) 1026 // Some C compilers warn about the comparison always being true when using
1027 ASSERT(value <= static_cast<uword>(kMaxUint32)); 1027 // <= due to limited range of data type.
1028 #endif 1028 ASSERT((value == static_cast<uword>(kMaxUint32)) ||
1029 (value < static_cast<uword>(kMaxUint32)));
1029 pc_offset_ = value; 1030 pc_offset_ = value;
1030 } 1031 }
1031 1032
1032 Kind kind() const { 1033 Kind kind() const {
1033 return static_cast<Kind>(deopt_id_and_kind_ & kAnyKind); 1034 return static_cast<Kind>(deopt_id_and_kind_ & kAnyKind);
1034 } 1035 }
1035 void set_kind(Kind kind) { 1036 void set_kind(Kind kind) {
1036 deopt_id_and_kind_ = (deopt_id_and_kind_ & 0xFFFFFF00) | kind; 1037 deopt_id_and_kind_ = (deopt_id_and_kind_ & 0xFFFFFF00) | kind;
1037 } 1038 }
1038 1039
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 1194
1194 friend class Object; 1195 friend class Object;
1195 }; 1196 };
1196 1197
1197 1198
1198 class RawExceptionHandlers : public RawObject { 1199 class RawExceptionHandlers : public RawObject {
1199 public: 1200 public:
1200 // The index into the ExceptionHandlers table corresponds to 1201 // The index into the ExceptionHandlers table corresponds to
1201 // the try_index of the handler. 1202 // the try_index of the handler.
1202 struct HandlerInfo { 1203 struct HandlerInfo {
1203 intptr_t handler_pc; // PC value of handler. 1204 uint32_t handler_pc_offset; // PC offset value of handler.
1204 int16_t outer_try_index; // Try block index of enclosing try block. 1205 int16_t outer_try_index; // Try block index of enclosing try block.
1205 int8_t needs_stacktrace; // True if a stacktrace is needed. 1206 int8_t needs_stacktrace; // True if a stacktrace is needed.
1206 int8_t has_catch_all; // Catches all exceptions. 1207 int8_t has_catch_all; // Catches all exceptions.
1207 }; 1208 };
1208 1209
1209 private: 1210 private:
1210 RAW_HEAP_OBJECT_IMPLEMENTATION(ExceptionHandlers); 1211 RAW_HEAP_OBJECT_IMPLEMENTATION(ExceptionHandlers);
1211 1212
1212 // Number of exception handler entries. 1213 // Number of exception handler entries.
1213 int32_t num_entries_; 1214 int32_t num_entries_;
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
2158 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2159 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2159 kTypedDataInt8ArrayViewCid + 15); 2160 kTypedDataInt8ArrayViewCid + 15);
2160 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2161 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2161 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2162 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2162 return (kNullCid - kTypedDataInt8ArrayCid); 2163 return (kNullCid - kTypedDataInt8ArrayCid);
2163 } 2164 }
2164 2165
2165 } // namespace dart 2166 } // namespace dart
2166 2167
2167 #endif // VM_RAW_OBJECT_H_ 2168 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698