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 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2446 // There are no real uses of the arguments object. | 2446 // There are no real uses of the arguments object. |
2447 // arguments.length and element access are supported directly on | 2447 // arguments.length and element access are supported directly on |
2448 // stack arguments, and any real arguments object use causes a bailout. | 2448 // stack arguments, and any real arguments object use causes a bailout. |
2449 // So this value is never used. | 2449 // So this value is never used. |
2450 return NULL; | 2450 return NULL; |
2451 } | 2451 } |
2452 | 2452 |
2453 | 2453 |
2454 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { | 2454 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { |
2455 LOperand* args = UseRegister(instr->arguments()); | 2455 LOperand* args = UseRegister(instr->arguments()); |
2456 LOperand* length = UseTempRegister(instr->length()); | 2456 LOperand* length; |
2457 LOperand* index = UseRegister(instr->index()); | 2457 LOperand* index; |
| 2458 if (instr->length()->IsConstant() && instr->index()->IsConstant()) { |
| 2459 length = UseRegisterOrConstant(instr->length()); |
| 2460 index = UseOrConstant(instr->index()); |
| 2461 } else { |
| 2462 length = UseTempRegister(instr->length()); |
| 2463 index = Use(instr->index()); |
| 2464 } |
2458 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); | 2465 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); |
2459 } | 2466 } |
2460 | 2467 |
2461 | 2468 |
2462 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { | 2469 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { |
2463 LOperand* object = UseFixed(instr->value(), r0); | 2470 LOperand* object = UseFixed(instr->value(), r0); |
2464 LToFastProperties* result = new(zone()) LToFastProperties(object); | 2471 LToFastProperties* result = new(zone()) LToFastProperties(object); |
2465 return MarkAsCall(DefineFixed(result, r0), instr); | 2472 return MarkAsCall(DefineFixed(result, r0), instr); |
2466 } | 2473 } |
2467 | 2474 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 | 2601 |
2595 | 2602 |
2596 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2603 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2597 LOperand* object = UseRegister(instr->object()); | 2604 LOperand* object = UseRegister(instr->object()); |
2598 LOperand* index = UseRegister(instr->index()); | 2605 LOperand* index = UseRegister(instr->index()); |
2599 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2606 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2600 } | 2607 } |
2601 | 2608 |
2602 | 2609 |
2603 } } // namespace v8::internal | 2610 } } // namespace v8::internal |
OLD | NEW |