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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 | 999 |
1000 | 1000 |
1001 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { | 1001 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { |
1002 return instr->HasNoUses() | 1002 return instr->HasNoUses() |
1003 ? NULL | 1003 ? NULL |
1004 : DefineAsRegister(new(zone()) LThisFunction); | 1004 : DefineAsRegister(new(zone()) LThisFunction); |
1005 } | 1005 } |
1006 | 1006 |
1007 | 1007 |
1008 LInstruction* LChunkBuilder::DoContext(HContext* instr) { | 1008 LInstruction* LChunkBuilder::DoContext(HContext* instr) { |
1009 return instr->HasNoUses() ? NULL : DefineAsRegister(new(zone()) LContext); | 1009 // If there is a non-return use, the context must be allocated in a register. |
| 1010 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { |
| 1011 if (!it.value()->IsReturn()) { |
| 1012 return DefineAsRegister(new(zone()) LContext); |
| 1013 } |
| 1014 } |
| 1015 |
| 1016 return NULL; |
1010 } | 1017 } |
1011 | 1018 |
1012 | 1019 |
1013 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { | 1020 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { |
1014 LOperand* context = UseRegisterAtStart(instr->value()); | 1021 LOperand* context = UseRegisterAtStart(instr->value()); |
1015 return DefineAsRegister(new(zone()) LOuterContext(context)); | 1022 return DefineAsRegister(new(zone()) LOuterContext(context)); |
1016 } | 1023 } |
1017 | 1024 |
1018 | 1025 |
1019 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { | 1026 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2327 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2334 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2328 LOperand* object = UseRegister(instr->object()); | 2335 LOperand* object = UseRegister(instr->object()); |
2329 LOperand* index = UseTempRegister(instr->index()); | 2336 LOperand* index = UseTempRegister(instr->index()); |
2330 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2337 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2331 } | 2338 } |
2332 | 2339 |
2333 | 2340 |
2334 } } // namespace v8::internal | 2341 } } // namespace v8::internal |
2335 | 2342 |
2336 #endif // V8_TARGET_ARCH_X64 | 2343 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |