OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 ASSERT(block() == NULL); | 1291 ASSERT(block() == NULL); |
1292 } | 1292 } |
1293 | 1293 |
1294 | 1294 |
1295 void HPhi::InitRealUses(int phi_id) { | 1295 void HPhi::InitRealUses(int phi_id) { |
1296 // Initialize real uses. | 1296 // Initialize real uses. |
1297 phi_id_ = phi_id; | 1297 phi_id_ = phi_id; |
1298 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { | 1298 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { |
1299 HValue* value = it.value(); | 1299 HValue* value = it.value(); |
1300 if (!value->IsPhi()) { | 1300 if (!value->IsPhi()) { |
1301 Representation rep = value->RequiredInputRepresentation(it.index()); | 1301 Representation rep = value->ObservedInputRepresentation(it.index()); |
1302 non_phi_uses_[rep.kind()] += value->LoopWeight(); | 1302 non_phi_uses_[rep.kind()] += value->LoopWeight(); |
| 1303 if (FLAG_trace_representation) { |
| 1304 PrintF("%d %s is used by %d %s as %s\n", |
| 1305 this->id(), |
| 1306 this->Mnemonic(), |
| 1307 value->id(), |
| 1308 value->Mnemonic(), |
| 1309 rep.Mnemonic()); |
| 1310 } |
1303 } | 1311 } |
1304 } | 1312 } |
1305 } | 1313 } |
1306 | 1314 |
1307 | 1315 |
1308 void HPhi::AddNonPhiUsesFrom(HPhi* other) { | 1316 void HPhi::AddNonPhiUsesFrom(HPhi* other) { |
| 1317 if (FLAG_trace_representation) { |
| 1318 PrintF("adding to %d %s uses of %d %s: i%d d%d t%d\n", |
| 1319 this->id(), |
| 1320 this->Mnemonic(), |
| 1321 other->id(), |
| 1322 other->Mnemonic(), |
| 1323 other->non_phi_uses_[Representation::kInteger32], |
| 1324 other->non_phi_uses_[Representation::kDouble], |
| 1325 other->non_phi_uses_[Representation::kTagged]); |
| 1326 } |
| 1327 |
1309 for (int i = 0; i < Representation::kNumRepresentations; i++) { | 1328 for (int i = 0; i < Representation::kNumRepresentations; i++) { |
1310 indirect_uses_[i] += other->non_phi_uses_[i]; | 1329 indirect_uses_[i] += other->non_phi_uses_[i]; |
1311 } | 1330 } |
1312 } | 1331 } |
1313 | 1332 |
1314 | 1333 |
1315 void HPhi::AddIndirectUsesTo(int* dest) { | 1334 void HPhi::AddIndirectUsesTo(int* dest) { |
1316 for (int i = 0; i < Representation::kNumRepresentations; i++) { | 1335 for (int i = 0; i < Representation::kNumRepresentations; i++) { |
1317 dest[i] += indirect_uses_[i]; | 1336 dest[i] += indirect_uses_[i]; |
1318 } | 1337 } |
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2451 | 2470 |
2452 | 2471 |
2453 void HCheckPrototypeMaps::Verify() { | 2472 void HCheckPrototypeMaps::Verify() { |
2454 HInstruction::Verify(); | 2473 HInstruction::Verify(); |
2455 ASSERT(HasNoUses()); | 2474 ASSERT(HasNoUses()); |
2456 } | 2475 } |
2457 | 2476 |
2458 #endif | 2477 #endif |
2459 | 2478 |
2460 } } // namespace v8::internal | 2479 } } // namespace v8::internal |
OLD | NEW |