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

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

Issue 16398008: Implements checks for 53-bit overflow for x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 10478 matching lines...) Expand 10 before | Expand all | Expand 10 after
10489 } 10489 }
10490 10490
10491 10491
10492 int Integer::CompareWith(const Integer& other) const { 10492 int Integer::CompareWith(const Integer& other) const {
10493 UNIMPLEMENTED(); 10493 UNIMPLEMENTED();
10494 return 0; 10494 return 0;
10495 } 10495 }
10496 10496
10497 10497
10498 static void CheckFiftyThreeBitOverflow(const Integer &i) { 10498 static void CheckFiftyThreeBitOverflow(const Integer &i) {
10499 if (i.IsSmi()) return;
10500 // Always overflow if the value doesn't fit into an int64_t. 10499 // Always overflow if the value doesn't fit into an int64_t.
10501 int64_t value = 1ULL << 63; 10500 int64_t value = 1ULL << 63;
10502 if (i.IsMint()) { 10501 if (i.IsSmi()) {
10502 value = i.AsInt64Value();
10503 } else if (i.IsMint()) {
10503 Mint& mint = Mint::Handle(); 10504 Mint& mint = Mint::Handle();
10504 mint ^= i.raw(); 10505 mint ^= i.raw();
10505 value = mint.value(); 10506 value = mint.value();
10506 } else { 10507 } else {
10507 ASSERT(i.IsBigint()); 10508 ASSERT(i.IsBigint());
10508 Bigint& big_value = Bigint::Handle(); 10509 Bigint& big_value = Bigint::Handle();
10509 big_value ^= i.raw(); 10510 big_value ^= i.raw();
10510 if (BigintOperations::FitsIntoInt64(big_value)) { 10511 if (BigintOperations::FitsIntoInt64(big_value)) {
10511 value = BigintOperations::ToInt64(big_value); 10512 value = BigintOperations::ToInt64(big_value);
10512 } 10513 }
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
13373 space); 13374 space);
13374 return reinterpret_cast<RawWeakProperty*>(raw); 13375 return reinterpret_cast<RawWeakProperty*>(raw);
13375 } 13376 }
13376 13377
13377 13378
13378 const char* WeakProperty::ToCString() const { 13379 const char* WeakProperty::ToCString() const {
13379 return "_WeakProperty"; 13380 return "_WeakProperty";
13380 } 13381 }
13381 13382
13382 } // namespace dart 13383 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698