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

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

Issue 17550009: In FiftyThreeBitOverflow, stores overflowing value as a string. (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
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('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 #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 10617 matching lines...) Expand 10 before | Expand all | Expand 10 after
10628 const char* Integer::ToCString() const { 10628 const char* Integer::ToCString() const {
10629 // Integer is an interface. No instances of Integer should exist. 10629 // Integer is an interface. No instances of Integer should exist.
10630 UNREACHABLE(); 10630 UNREACHABLE();
10631 return "Integer"; 10631 return "Integer";
10632 } 10632 }
10633 10633
10634 10634
10635 // Throw FiftyThreeBitOverflow exception. 10635 // Throw FiftyThreeBitOverflow exception.
10636 static void ThrowFiftyThreeBitOverflow(const Integer& i) { 10636 static void ThrowFiftyThreeBitOverflow(const Integer& i) {
10637 const Array& exc_args = Array::Handle(Array::New(1)); 10637 const Array& exc_args = Array::Handle(Array::New(1));
10638 exc_args.SetAt(0, i); 10638 const String& i_str = String::Handle(String::New(i.ToCString()));
10639 exc_args.SetAt(0, i_str);
10639 Exceptions::ThrowByType(Exceptions::kFiftyThreeBitOverflowError, exc_args); 10640 Exceptions::ThrowByType(Exceptions::kFiftyThreeBitOverflowError, exc_args);
10640 } 10641 }
10641 10642
10642 10643
10643 RawInteger* Integer::New(const String& str, Heap::Space space) { 10644 RawInteger* Integer::New(const String& str, Heap::Space space) {
10644 // We are not supposed to have integers represented as two byte strings. 10645 // We are not supposed to have integers represented as two byte strings.
10645 ASSERT(str.IsOneByteString()); 10646 ASSERT(str.IsOneByteString());
10646 int64_t value; 10647 int64_t value;
10647 if (!OS::StringToInt64(str.ToCString(), &value)) { 10648 if (!OS::StringToInt64(str.ToCString(), &value)) {
10648 const Bigint& big = Bigint::Handle(Bigint::New(str, space)); 10649 const Bigint& big = Bigint::Handle(Bigint::New(str, space));
(...skipping 2979 matching lines...) Expand 10 before | Expand all | Expand 10 after
13628 space); 13629 space);
13629 return reinterpret_cast<RawWeakProperty*>(raw); 13630 return reinterpret_cast<RawWeakProperty*>(raw);
13630 } 13631 }
13631 13632
13632 13633
13633 const char* WeakProperty::ToCString() const { 13634 const char* WeakProperty::ToCString() const {
13634 return "_WeakProperty"; 13635 return "_WeakProperty";
13635 } 13636 }
13636 13637
13637 } // namespace dart 13638 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698