| 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/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2342 dst_type(), | 2342 dst_type(), |
| 2343 dst_name(), | 2343 dst_name(), |
| 2344 locs()); | 2344 locs()); |
| 2345 ASSERT(locs()->in(0).reg() == locs()->out(0).reg()); | 2345 ASSERT(locs()->in(0).reg() == locs()->out(0).reg()); |
| 2346 } | 2346 } |
| 2347 | 2347 |
| 2348 | 2348 |
| 2349 Environment* Environment::From(Isolate* isolate, | 2349 Environment* Environment::From(Isolate* isolate, |
| 2350 const GrowableArray<Definition*>& definitions, | 2350 const GrowableArray<Definition*>& definitions, |
| 2351 intptr_t fixed_parameter_count, | 2351 intptr_t fixed_parameter_count, |
| 2352 const Code& code) { | 2352 const ParsedFunction* parsed_function) { |
| 2353 Environment* env = | 2353 Environment* env = |
| 2354 new(isolate) Environment(definitions.length(), | 2354 new(isolate) Environment(definitions.length(), |
| 2355 fixed_parameter_count, | 2355 fixed_parameter_count, |
| 2356 Isolate::kNoDeoptId, | 2356 Isolate::kNoDeoptId, |
| 2357 code, | 2357 parsed_function, |
| 2358 NULL); | 2358 NULL); |
| 2359 for (intptr_t i = 0; i < definitions.length(); ++i) { | 2359 for (intptr_t i = 0; i < definitions.length(); ++i) { |
| 2360 env->values_.Add(new(isolate) Value(definitions[i])); | 2360 env->values_.Add(new(isolate) Value(definitions[i])); |
| 2361 } | 2361 } |
| 2362 return env; | 2362 return env; |
| 2363 } | 2363 } |
| 2364 | 2364 |
| 2365 | 2365 |
| 2366 Environment* Environment::DeepCopy(Isolate* isolate, intptr_t length) const { | 2366 Environment* Environment::DeepCopy(Isolate* isolate, intptr_t length) const { |
| 2367 ASSERT(length <= values_.length()); | 2367 ASSERT(length <= values_.length()); |
| 2368 Environment* copy = | 2368 Environment* copy = new(isolate) Environment( |
| 2369 new(isolate) Environment( | 2369 length, |
| 2370 length, | 2370 fixed_parameter_count_, |
| 2371 fixed_parameter_count_, | 2371 deopt_id_, |
| 2372 deopt_id_, | 2372 parsed_function_, |
| 2373 code_, | 2373 (outer_ == NULL) ? NULL : outer_->DeepCopy(isolate)); |
| 2374 (outer_ == NULL) ? NULL : outer_->DeepCopy(isolate)); | |
| 2375 if (locations_ != NULL) { | 2374 if (locations_ != NULL) { |
| 2376 Location* new_locations = isolate->current_zone()->Alloc<Location>(length); | 2375 Location* new_locations = isolate->current_zone()->Alloc<Location>(length); |
| 2377 copy->set_locations(new_locations); | 2376 copy->set_locations(new_locations); |
| 2378 } | 2377 } |
| 2379 for (intptr_t i = 0; i < length; ++i) { | 2378 for (intptr_t i = 0; i < length; ++i) { |
| 2380 copy->values_.Add(values_[i]->Copy(isolate)); | 2379 copy->values_.Add(values_[i]->Copy(isolate)); |
| 2381 if (locations_ != NULL) { | 2380 if (locations_ != NULL) { |
| 2382 copy->locations_[i] = locations_[i].Copy(); | 2381 copy->locations_[i] = locations_[i].Copy(); |
| 2383 } | 2382 } |
| 2384 } | 2383 } |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3454 case Token::kTRUNCDIV: return 0; | 3453 case Token::kTRUNCDIV: return 0; |
| 3455 case Token::kMOD: return 1; | 3454 case Token::kMOD: return 1; |
| 3456 default: UNIMPLEMENTED(); return -1; | 3455 default: UNIMPLEMENTED(); return -1; |
| 3457 } | 3456 } |
| 3458 } | 3457 } |
| 3459 | 3458 |
| 3460 | 3459 |
| 3461 #undef __ | 3460 #undef __ |
| 3462 | 3461 |
| 3463 } // namespace dart | 3462 } // namespace dart |
| OLD | NEW |