Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/constant_propagator.h" | 10 #include "vm/constant_propagator.h" |
| (...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1811 case Token::kDIV: | 1811 case Token::kDIV: |
| 1812 break; | 1812 break; |
| 1813 default: | 1813 default: |
| 1814 UNREACHABLE(); | 1814 UNREACHABLE(); |
| 1815 } | 1815 } |
| 1816 | 1816 |
| 1817 if (!result.IsNull()) { | 1817 if (!result.IsNull()) { |
| 1818 if (is_truncating()) { | 1818 if (is_truncating()) { |
| 1819 int64_t truncated = result.AsTruncatedInt64Value(); | 1819 int64_t truncated = result.AsTruncatedInt64Value(); |
| 1820 truncated &= RepresentationMask(representation()); | 1820 truncated &= RepresentationMask(representation()); |
| 1821 result = Integer::New(truncated); | 1821 result = Integer::New(truncated, Heap::kOld); |
|
siva
2017/07/07 23:11:20
Why is it necessary to allocate in old space? the
alexmarkov
2017/07/10 16:58:12
It is a bug fix. This code is used to do constant
| |
| 1822 ASSERT(IsRepresentable(result, representation())); | 1822 ASSERT(IsRepresentable(result, representation())); |
| 1823 } else if (!IsRepresentable(result, representation())) { | 1823 } else if (!IsRepresentable(result, representation())) { |
| 1824 // If this operation is not truncating it would deoptimize on overflow. | 1824 // If this operation is not truncating it would deoptimize on overflow. |
| 1825 // Check that we match this behavior and don't produce a value that is | 1825 // Check that we match this behavior and don't produce a value that is |
| 1826 // larger than something this operation can produce. We could have | 1826 // larger than something this operation can produce. We could have |
| 1827 // specialized instructions that use this value under this assumption. | 1827 // specialized instructions that use this value under this assumption. |
| 1828 return Integer::null(); | 1828 return Integer::null(); |
| 1829 } | 1829 } |
| 1830 result ^= result.CheckAndCanonicalize(thread, NULL); | 1830 result ^= result.CheckAndCanonicalize(thread, NULL); |
| 1831 } | 1831 } |
| (...skipping 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4401 "native function '%s' (%" Pd " arguments) cannot be found", | 4401 "native function '%s' (%" Pd " arguments) cannot be found", |
| 4402 native_name().ToCString(), function().NumParameters()); | 4402 native_name().ToCString(), function().NumParameters()); |
| 4403 } | 4403 } |
| 4404 set_is_auto_scope(auto_setup_scope); | 4404 set_is_auto_scope(auto_setup_scope); |
| 4405 set_native_c_function(native_function); | 4405 set_native_c_function(native_function); |
| 4406 } | 4406 } |
| 4407 | 4407 |
| 4408 #undef __ | 4408 #undef __ |
| 4409 | 4409 |
| 4410 } // namespace dart | 4410 } // namespace dart |
| OLD | NEW |