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

Side by Side Diff: src/lithium.cc

Issue 14639008: Allow more virtual registers to be encoded in LUnallocated. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « src/lithium.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 void LOperand::PrintTo(StringStream* stream) { 52 void LOperand::PrintTo(StringStream* stream) {
53 LUnallocated* unalloc = NULL; 53 LUnallocated* unalloc = NULL;
54 switch (kind()) { 54 switch (kind()) {
55 case INVALID: 55 case INVALID:
56 stream->Add("(0)"); 56 stream->Add("(0)");
57 break; 57 break;
58 case UNALLOCATED: 58 case UNALLOCATED:
59 unalloc = LUnallocated::cast(this); 59 unalloc = LUnallocated::cast(this);
60 stream->Add("v%d", unalloc->virtual_register()); 60 stream->Add("v%d", unalloc->virtual_register());
61 switch (unalloc->policy()) { 61 if (unalloc->basic_policy() == LUnallocated::FIXED_SLOT) {
62 stream->Add("(=%dS)", unalloc->fixed_slot_index());
63 break;
64 }
65 switch (unalloc->extended_policy()) {
62 case LUnallocated::NONE: 66 case LUnallocated::NONE:
63 break; 67 break;
64 case LUnallocated::FIXED_REGISTER: { 68 case LUnallocated::FIXED_REGISTER: {
69 int reg_index = unalloc->fixed_register_index();
65 const char* register_name = 70 const char* register_name =
66 Register::AllocationIndexToString(unalloc->fixed_index()); 71 Register::AllocationIndexToString(reg_index);
67 stream->Add("(=%s)", register_name); 72 stream->Add("(=%s)", register_name);
68 break; 73 break;
69 } 74 }
70 case LUnallocated::FIXED_DOUBLE_REGISTER: { 75 case LUnallocated::FIXED_DOUBLE_REGISTER: {
76 int reg_index = unalloc->fixed_register_index();
71 const char* double_register_name = 77 const char* double_register_name =
72 DoubleRegister::AllocationIndexToString(unalloc->fixed_index()); 78 DoubleRegister::AllocationIndexToString(reg_index);
73 stream->Add("(=%s)", double_register_name); 79 stream->Add("(=%s)", double_register_name);
74 break; 80 break;
75 } 81 }
76 case LUnallocated::FIXED_SLOT:
77 stream->Add("(=%dS)", unalloc->fixed_index());
78 break;
79 case LUnallocated::MUST_HAVE_REGISTER: 82 case LUnallocated::MUST_HAVE_REGISTER:
80 stream->Add("(R)"); 83 stream->Add("(R)");
81 break; 84 break;
82 case LUnallocated::WRITABLE_REGISTER: 85 case LUnallocated::WRITABLE_REGISTER:
83 stream->Add("(WR)"); 86 stream->Add("(WR)");
84 break; 87 break;
85 case LUnallocated::SAME_AS_FIRST_INPUT: 88 case LUnallocated::SAME_AS_FIRST_INPUT:
86 stream->Add("(1)"); 89 stream->Add("(1)");
87 break; 90 break;
88 case LUnallocated::ANY: 91 case LUnallocated::ANY:
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 } else { 489 } else {
487 spill_slot_count_++; 490 spill_slot_count_++;
488 } 491 }
489 } 492 }
490 iterator.Advance(); 493 iterator.Advance();
491 } 494 }
492 } 495 }
493 496
494 497
495 } } // namespace v8::internal 498 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/lithium.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698