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

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

Issue 10826184: Move all register allocator environment initialization into class Environment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « runtime/vm/intermediate_language.h ('k') | no next file » | 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/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/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h"
9 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 11 #include "vm/flow_graph_compiler.h"
11 #include "vm/locations.h" 12 #include "vm/locations.h"
12 #include "vm/object.h" 13 #include "vm/object.h"
13 #include "vm/os.h" 14 #include "vm/os.h"
14 #include "vm/scopes.h" 15 #include "vm/scopes.h"
15 #include "vm/stub_code.h" 16 #include "vm/stub_code.h"
16 #include "vm/symbols.h" 17 #include "vm/symbols.h"
17 18
18 namespace dart { 19 namespace dart {
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 // Instead of popping the value it is left alone on the simulated frame 1353 // Instead of popping the value it is left alone on the simulated frame
1353 // and materialized on the physical stack before the call. 1354 // and materialized on the physical stack before the call.
1354 // TODO(fschneider): Avoid special-casing for SSA mode here. 1355 // TODO(fschneider): Avoid special-casing for SSA mode here.
1355 if (compiler->is_ssa()) { 1356 if (compiler->is_ssa()) {
1356 ASSERT(locs()->in(0).IsRegister()); 1357 ASSERT(locs()->in(0).IsRegister());
1357 __ PushRegister(locs()->in(0).reg()); 1358 __ PushRegister(locs()->in(0).reg());
1358 } 1359 }
1359 } 1360 }
1360 1361
1361 1362
1363 void Environment::InitializeLocations(FlowGraphAllocator* allocator,
1364 intptr_t block_start_pos,
1365 intptr_t environment_pos) {
1366 // Any value mentioned in the deoptimization environment should survive
1367 // until the end of instruction but it does not need to be in the register.
1368 // Expected shape of live range:
1369 //
1370 // i i'
1371 // value -----*
1372 //
1373 ASSERT(locations_ == NULL);
1374 location_count_ = values_.length();
1375 if (location_count_ > 0) {
1376 locations_ =
1377 Isolate::Current()->current_zone()->Alloc<Location>(location_count_);
1378 for (intptr_t i = 0; i < location_count_; ++i) {
1379 Value* value = values_[i];
1380 if (value->IsUse()) {
1381 locations_[i] = Location::Any();
1382 const intptr_t vreg = value->AsUse()->definition()->ssa_temp_index();
1383 LiveRange* range = allocator->GetLiveRange(vreg);
1384 range->AddUseInterval(block_start_pos, environment_pos);
1385 range->AddUse(environment_pos, &locations_[i]);
1386 } else {
1387 ASSERT(value->IsConstant());
1388 locations_[i] = Location::NoLocation();
1389 }
1390 }
1391 }
1392 }
1393
1394
1362 #undef __ 1395 #undef __
1363 1396
1364 } // namespace dart 1397 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698