Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 12357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12368 ASSERT(!BigintOperations::FitsIntoInt64(big)); | 12368 ASSERT(!BigintOperations::FitsIntoInt64(big)); |
| 12369 return big.raw(); | 12369 return big.raw(); |
| 12370 } | 12370 } |
| 12371 if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) { | 12371 if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) { |
| 12372 return Smi::New(value); | 12372 return Smi::New(value); |
| 12373 } | 12373 } |
| 12374 return Mint::NewCanonical(value); | 12374 return Mint::NewCanonical(value); |
| 12375 } | 12375 } |
| 12376 | 12376 |
| 12377 | 12377 |
| 12378 RawInteger* Integer::NewCanonical(int64_t value) { | |
|
Ivan Posva
2013/10/29 21:42:59
Please remove as this is not needed anywhere as fa
Søren Gjesse
2013/10/30 11:44:02
Done.
| |
| 12379 if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) { | |
| 12380 return Smi::New(value); | |
| 12381 } | |
| 12382 return Mint::NewCanonical(value); | |
| 12383 } | |
| 12384 | |
| 12378 // dart2js represents integers as double precision floats, which can represent | 12385 // dart2js represents integers as double precision floats, which can represent |
| 12379 // anything in the range -2^53 ... 2^53. | 12386 // anything in the range -2^53 ... 2^53. |
| 12380 static bool IsJavascriptInt(int64_t value) { | 12387 static bool IsJavascriptInt(int64_t value) { |
| 12381 return ((-0x20000000000000LL <= value) && (value <= 0x20000000000000LL)); | 12388 return ((-0x20000000000000LL <= value) && (value <= 0x20000000000000LL)); |
| 12382 } | 12389 } |
| 12383 | 12390 |
| 12384 | 12391 |
| 12385 RawInteger* Integer::New(int64_t value, Heap::Space space, const bool silent) { | 12392 RawInteger* Integer::New(int64_t value, Heap::Space space, const bool silent) { |
| 12386 if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) { | 12393 if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) { |
| 12387 return Smi::New(value); | 12394 return Smi::New(value); |
| (...skipping 3196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 15584 return "_MirrorReference"; | 15591 return "_MirrorReference"; |
| 15585 } | 15592 } |
| 15586 | 15593 |
| 15587 | 15594 |
| 15588 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 15595 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 15589 JSONObject jsobj(stream); | 15596 JSONObject jsobj(stream); |
| 15590 } | 15597 } |
| 15591 | 15598 |
| 15592 | 15599 |
| 15593 } // namespace dart | 15600 } // namespace dart |
| OLD | NEW |