| 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/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
| (...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2017 deopt_id(), | 2017 deopt_id(), |
| 2018 dst_type(), | 2018 dst_type(), |
| 2019 dst_name(), | 2019 dst_name(), |
| 2020 locs()); | 2020 locs()); |
| 2021 ASSERT(locs()->in(0).reg() == locs()->out().reg()); | 2021 ASSERT(locs()->in(0).reg() == locs()->out().reg()); |
| 2022 } | 2022 } |
| 2023 | 2023 |
| 2024 | 2024 |
| 2025 Environment* Environment::From(const GrowableArray<Definition*>& definitions, | 2025 Environment* Environment::From(const GrowableArray<Definition*>& definitions, |
| 2026 intptr_t fixed_parameter_count, | 2026 intptr_t fixed_parameter_count, |
| 2027 const Function& function) { | 2027 const Code& code) { |
| 2028 Environment* env = | 2028 Environment* env = |
| 2029 new Environment(definitions.length(), | 2029 new Environment(definitions.length(), |
| 2030 fixed_parameter_count, | 2030 fixed_parameter_count, |
| 2031 Isolate::kNoDeoptId, | 2031 Isolate::kNoDeoptId, |
| 2032 function, | 2032 code, |
| 2033 NULL); | 2033 NULL); |
| 2034 for (intptr_t i = 0; i < definitions.length(); ++i) { | 2034 for (intptr_t i = 0; i < definitions.length(); ++i) { |
| 2035 env->values_.Add(new Value(definitions[i])); | 2035 env->values_.Add(new Value(definitions[i])); |
| 2036 } | 2036 } |
| 2037 return env; | 2037 return env; |
| 2038 } | 2038 } |
| 2039 | 2039 |
| 2040 | 2040 |
| 2041 Environment* Environment::DeepCopy(intptr_t length) const { | 2041 Environment* Environment::DeepCopy(intptr_t length) const { |
| 2042 ASSERT(length <= values_.length()); | 2042 ASSERT(length <= values_.length()); |
| 2043 Environment* copy = | 2043 Environment* copy = |
| 2044 new Environment(length, | 2044 new Environment(length, |
| 2045 fixed_parameter_count_, | 2045 fixed_parameter_count_, |
| 2046 deopt_id_, | 2046 deopt_id_, |
| 2047 function_, | 2047 code_, |
| 2048 (outer_ == NULL) ? NULL : outer_->DeepCopy()); | 2048 (outer_ == NULL) ? NULL : outer_->DeepCopy()); |
| 2049 if (locations_ != NULL) { | 2049 if (locations_ != NULL) { |
| 2050 Location* new_locations = | 2050 Location* new_locations = |
| 2051 Isolate::Current()->current_zone()->Alloc<Location>(length); | 2051 Isolate::Current()->current_zone()->Alloc<Location>(length); |
| 2052 copy->set_locations(new_locations); | 2052 copy->set_locations(new_locations); |
| 2053 } | 2053 } |
| 2054 for (intptr_t i = 0; i < length; ++i) { | 2054 for (intptr_t i = 0; i < length; ++i) { |
| 2055 copy->values_.Add(values_[i]->Copy()); | 2055 copy->values_.Add(values_[i]->Copy()); |
| 2056 if (locations_ != NULL) { | 2056 if (locations_ != NULL) { |
| 2057 copy->locations_[i] = locations_[i]; | 2057 copy->locations_[i] = locations_[i]; |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2950 ASSERT((*inputs)[i] != NULL); | 2950 ASSERT((*inputs)[i] != NULL); |
| 2951 (*inputs)[i]->set_instruction(this); | 2951 (*inputs)[i]->set_instruction(this); |
| 2952 (*inputs)[i]->set_use_index(i); | 2952 (*inputs)[i]->set_use_index(i); |
| 2953 } | 2953 } |
| 2954 deopt_id_ = original_deopt_id; | 2954 deopt_id_ = original_deopt_id; |
| 2955 } | 2955 } |
| 2956 | 2956 |
| 2957 #undef __ | 2957 #undef __ |
| 2958 | 2958 |
| 2959 } // namespace dart | 2959 } // namespace dart |
| OLD | NEW |