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

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

Issue 281823002: Fix an undetected Smi overflow on ARM. (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 4921 matching lines...) Expand 10 before | Expand all | Expand 10 after
4932 4932
4933 OBJECT_IMPLEMENTATION(Integer, Number); 4933 OBJECT_IMPLEMENTATION(Integer, Number);
4934 friend class Class; 4934 friend class Class;
4935 }; 4935 };
4936 4936
4937 4937
4938 class Smi : public Integer { 4938 class Smi : public Integer {
4939 public: 4939 public:
4940 static const intptr_t kBits = kSmiBits; 4940 static const intptr_t kBits = kSmiBits;
4941 static const intptr_t kMaxValue = kSmiMax; 4941 static const intptr_t kMaxValue = kSmiMax;
4942 static const intptr_t kMinValue = kSmiMin; 4942 static const intptr_t kMinValue = kSmiMin;
4943 4943
4944 intptr_t Value() const { 4944 intptr_t Value() const {
4945 return ValueFromRaw(raw_value()); 4945 return ValueFromRaw(raw_value());
4946 } 4946 }
4947 4947
4948 virtual bool Equals(const Instance& other) const; 4948 virtual bool Equals(const Instance& other) const;
4949 virtual bool IsZero() const { return Value() == 0; } 4949 virtual bool IsZero() const { return Value() == 0; }
4950 virtual bool IsNegative() const { return Value() < 0; } 4950 virtual bool IsNegative() const { return Value() < 0; }
4951 // Smi values are implicitly canonicalized. 4951 // Smi values are implicitly canonicalized.
4952 virtual RawInstance* CheckAndCanonicalize(const char** error_str) const { 4952 virtual RawInstance* CheckAndCanonicalize(const char** error_str) const {
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after
7069 7069
7070 7070
7071 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7071 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7072 intptr_t index) { 7072 intptr_t index) {
7073 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7073 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7074 } 7074 }
7075 7075
7076 } // namespace dart 7076 } // namespace dart
7077 7077
7078 #endif // VM_OBJECT_H_ 7078 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | tests/language/arithmetic_smi_overflow_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698