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 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 // arguments.length and element access are supported directly on | 2333 // arguments.length and element access are supported directly on |
2334 // stack arguments, and any real arguments object use causes a bailout. | 2334 // stack arguments, and any real arguments object use causes a bailout. |
2335 // So this value is never used. | 2335 // So this value is never used. |
2336 return NULL; | 2336 return NULL; |
2337 } | 2337 } |
2338 | 2338 |
2339 | 2339 |
2340 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { | 2340 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { |
2341 info()->MarkAsRequiresFrame(); | 2341 info()->MarkAsRequiresFrame(); |
2342 LOperand* args = UseRegister(instr->arguments()); | 2342 LOperand* args = UseRegister(instr->arguments()); |
2343 LOperand* length = UseTempRegister(instr->length()); | 2343 LOperand* length; |
2344 LOperand* index = UseRegister(instr->index()); | 2344 LOperand* index; |
| 2345 if (instr->length()->IsConstant() && instr->index()->IsConstant()) { |
| 2346 length = UseRegisterOrConstant(instr->length()); |
| 2347 index = UseOrConstant(instr->index()); |
| 2348 } else { |
| 2349 length = UseTempRegister(instr->length()); |
| 2350 index = Use(instr->index()); |
| 2351 } |
2345 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); | 2352 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); |
2346 } | 2353 } |
2347 | 2354 |
2348 | 2355 |
2349 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { | 2356 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { |
2350 LOperand* object = UseFixed(instr->value(), a0); | 2357 LOperand* object = UseFixed(instr->value(), a0); |
2351 LToFastProperties* result = new(zone()) LToFastProperties(object); | 2358 LToFastProperties* result = new(zone()) LToFastProperties(object); |
2352 return MarkAsCall(DefineFixed(result, v0), instr); | 2359 return MarkAsCall(DefineFixed(result, v0), instr); |
2353 } | 2360 } |
2354 | 2361 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2481 | 2488 |
2482 | 2489 |
2483 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2490 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2484 LOperand* object = UseRegister(instr->object()); | 2491 LOperand* object = UseRegister(instr->object()); |
2485 LOperand* index = UseRegister(instr->index()); | 2492 LOperand* index = UseRegister(instr->index()); |
2486 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2493 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2487 } | 2494 } |
2488 | 2495 |
2489 | 2496 |
2490 } } // namespace v8::internal | 2497 } } // namespace v8::internal |
OLD | NEW |