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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 | 995 |
996 | 996 |
997 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { | 997 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { |
998 return instr->HasNoUses() | 998 return instr->HasNoUses() |
999 ? NULL | 999 ? NULL |
1000 : DefineAsRegister(new(zone()) LThisFunction); | 1000 : DefineAsRegister(new(zone()) LThisFunction); |
1001 } | 1001 } |
1002 | 1002 |
1003 | 1003 |
1004 LInstruction* LChunkBuilder::DoContext(HContext* instr) { | 1004 LInstruction* LChunkBuilder::DoContext(HContext* instr) { |
1005 return instr->HasNoUses() ? NULL : DefineAsRegister(new(zone()) LContext); | 1005 // If there is a non-return use, the context must be allocated in a register. |
| 1006 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { |
| 1007 if (!it.value()->IsReturn()) { |
| 1008 return DefineAsRegister(new(zone()) LContext); |
| 1009 } |
| 1010 } |
| 1011 |
| 1012 return NULL; |
1006 } | 1013 } |
1007 | 1014 |
1008 | 1015 |
1009 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { | 1016 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { |
1010 LOperand* context = UseRegisterAtStart(instr->value()); | 1017 LOperand* context = UseRegisterAtStart(instr->value()); |
1011 return DefineAsRegister(new(zone()) LOuterContext(context)); | 1018 return DefineAsRegister(new(zone()) LOuterContext(context)); |
1012 } | 1019 } |
1013 | 1020 |
1014 | 1021 |
1015 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { | 1022 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { |
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2278 | 2285 |
2279 | 2286 |
2280 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2287 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2281 LOperand* object = UseRegister(instr->object()); | 2288 LOperand* object = UseRegister(instr->object()); |
2282 LOperand* index = UseRegister(instr->index()); | 2289 LOperand* index = UseRegister(instr->index()); |
2283 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2290 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2284 } | 2291 } |
2285 | 2292 |
2286 | 2293 |
2287 } } // namespace v8::internal | 2294 } } // namespace v8::internal |
OLD | NEW |