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

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

Issue 260713008: Add support for javascript incompatibility warnings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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
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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define 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 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after
3301 bool HasDeoptReasons() const { return DeoptReasons() != 0; } 3301 bool HasDeoptReasons() const { return DeoptReasons() != 0; }
3302 uint32_t DeoptReasons() const; 3302 uint32_t DeoptReasons() const;
3303 void SetDeoptReasons(uint32_t reasons) const; 3303 void SetDeoptReasons(uint32_t reasons) const;
3304 3304
3305 bool HasDeoptReason(ICData::DeoptReasonId reason) const; 3305 bool HasDeoptReason(ICData::DeoptReasonId reason) const;
3306 void AddDeoptReason(ICData::DeoptReasonId reason) const; 3306 void AddDeoptReason(ICData::DeoptReasonId reason) const;
3307 3307
3308 bool IssuedJSWarning() const; 3308 bool IssuedJSWarning() const;
3309 void SetIssuedJSWarning() const; 3309 void SetIssuedJSWarning() const;
3310 3310
3311 // Return true if the target function of this IC data may check for (and
3312 // possibly issue) a Javascript compatibility warning.
3313 bool MayCheckForJSWarning() const;
3314
3311 bool IsClosureCall() const; 3315 bool IsClosureCall() const;
3312 void SetIsClosureCall() const; 3316 void SetIsClosureCall() const;
3313 3317
3314 intptr_t NumberOfChecks() const; 3318 intptr_t NumberOfChecks() const;
3315 3319
3316 static intptr_t InstanceSize() { 3320 static intptr_t InstanceSize() {
3317 return RoundedAllocationSize(sizeof(RawICData)); 3321 return RoundedAllocationSize(sizeof(RawICData));
3318 } 3322 }
3319 3323
3320 static intptr_t target_name_offset() { 3324 static intptr_t target_name_offset() {
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
4008 }; 4012 };
4009 4013
4010 4014
4011 class LanguageError : public Error { 4015 class LanguageError : public Error {
4012 public: 4016 public:
4013 enum Kind { 4017 enum Kind {
4014 kWarning, 4018 kWarning,
4015 kError, 4019 kError,
4016 kMalformedType, 4020 kMalformedType,
4017 kMalboundedType, 4021 kMalboundedType,
4022 kBailout,
4018 }; 4023 };
4019 4024
4020 Kind kind() const { return static_cast<Kind>(raw_ptr()->kind_); } 4025 Kind kind() const { return static_cast<Kind>(raw_ptr()->kind_); }
4021 4026
4022 // Build, cache, and return formatted message. 4027 // Build, cache, and return formatted message.
4023 RawString* FormatMessage() const; 4028 RawString* FormatMessage() const;
4024 4029
4025 static intptr_t InstanceSize() { 4030 static intptr_t InstanceSize() {
4026 return RoundedAllocationSize(sizeof(RawLanguageError)); 4031 return RoundedAllocationSize(sizeof(RawLanguageError));
4027 } 4032 }
4028 4033
4029 // A null script means no source and a negative token_pos means no position. 4034 // A null script means no source and a negative token_pos means no position.
4030 static RawLanguageError* NewFormatted(const Error& prev_error, 4035 static RawLanguageError* NewFormatted(const Error& prev_error,
4031 const Script& script, 4036 const Script& script,
4032 intptr_t token_pos, 4037 intptr_t token_pos,
4033 Kind kind, 4038 Kind kind,
4034 Heap::Space space, 4039 Heap::Space space,
4035 const char* format, ...) 4040 const char* format, ...)
4036 PRINTF_ATTRIBUTE(6, 7); 4041 PRINTF_ATTRIBUTE(6, 7);
4037 4042
4038 static RawLanguageError* NewFormattedV(const Error& prev_error, 4043 static RawLanguageError* NewFormattedV(const Error& prev_error,
4039 const Script& script, 4044 const Script& script,
4040 intptr_t token_pos, 4045 intptr_t token_pos,
4041 Kind kind, 4046 Kind kind,
4042 Heap::Space space, 4047 Heap::Space space,
4043 const char* format, va_list args); 4048 const char* format, va_list args);
4044 4049
4045 static RawLanguageError* New(const String& formatted_message, 4050 static RawLanguageError* New(const String& formatted_message,
4051 Kind kind = kError,
4046 Heap::Space space = Heap::kNew); 4052 Heap::Space space = Heap::kNew);
4047 4053
4048 virtual const char* ToErrorCString() const; 4054 virtual const char* ToErrorCString() const;
4049 4055
4050 private: 4056 private:
4051 RawError* previous_error() const { 4057 RawError* previous_error() const {
4052 return raw_ptr()->previous_error_; 4058 return raw_ptr()->previous_error_;
4053 } 4059 }
4054 void set_previous_error(const Error& value) const; 4060 void set_previous_error(const Error& value) const;
4055 4061
(...skipping 2807 matching lines...) Expand 10 before | Expand all | Expand 10 after
6863 }; 6869 };
6864 6870
6865 6871
6866 class UserTag : public Instance { 6872 class UserTag : public Instance {
6867 public: 6873 public:
6868 uword tag() const { return raw_ptr()->tag(); } 6874 uword tag() const { return raw_ptr()->tag(); }
6869 void set_tag(uword t) const { 6875 void set_tag(uword t) const {
6870 ASSERT(t >= UserTags::kUserTagIdOffset); 6876 ASSERT(t >= UserTags::kUserTagIdOffset);
6871 ASSERT(t < UserTags::kUserTagIdOffset + UserTags::kMaxUserTags); 6877 ASSERT(t < UserTags::kUserTagIdOffset + UserTags::kMaxUserTags);
6872 raw_ptr()->tag_ = t; 6878 raw_ptr()->tag_ = t;
6873 }; 6879 }
6874 static intptr_t tag_offset() { return OFFSET_OF(RawUserTag, tag_); } 6880 static intptr_t tag_offset() { return OFFSET_OF(RawUserTag, tag_); }
6875 6881
6876 RawString* label() const { 6882 RawString* label() const {
6877 return raw_ptr()->label_; 6883 return raw_ptr()->label_;
6878 } 6884 }
6879 6885
6880 void MakeActive() const; 6886 void MakeActive() const;
6881 6887
6882 static intptr_t InstanceSize() { 6888 static intptr_t InstanceSize() {
6883 return RoundedAllocationSize(sizeof(RawUserTag)); 6889 return RoundedAllocationSize(sizeof(RawUserTag));
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
7036 7042
7037 7043
7038 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7044 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7039 intptr_t index) { 7045 intptr_t index) {
7040 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7046 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7041 } 7047 }
7042 7048
7043 } // namespace dart 7049 } // namespace dart
7044 7050
7045 #endif // VM_OBJECT_H_ 7051 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/symbols.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698