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 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2433 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { | 2433 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
2434 // There are no real uses of the arguments object. | 2434 // There are no real uses of the arguments object. |
2435 // arguments.length and element access are supported directly on | 2435 // arguments.length and element access are supported directly on |
2436 // stack arguments, and any real arguments object use causes a bailout. | 2436 // stack arguments, and any real arguments object use causes a bailout. |
2437 // So this value is never used. | 2437 // So this value is never used. |
2438 return NULL; | 2438 return NULL; |
2439 } | 2439 } |
2440 | 2440 |
2441 | 2441 |
2442 LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) { | 2442 LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) { |
| 2443 HEnvironment* env = current_block_->last_environment(); |
| 2444 ASSERT(env != NULL); |
| 2445 |
| 2446 // Replay captured objects by replacing all captured objects with the |
| 2447 // same capture id in the current and all outer environments. |
| 2448 while (env != NULL) { |
| 2449 for (int i = 0; i < env->length(); ++i) { |
| 2450 HValue* value = env->values()->at(i); |
| 2451 if (value->IsCapturedObject() && |
| 2452 HCapturedObject::cast(value)->capture_id() == instr->capture_id()) { |
| 2453 env->SetValueAt(i, instr); |
| 2454 } |
| 2455 } |
| 2456 env = env->outer(); |
| 2457 } |
| 2458 |
2443 // There are no real uses of a captured object. | 2459 // There are no real uses of a captured object. |
2444 return NULL; | 2460 return NULL; |
2445 } | 2461 } |
2446 | 2462 |
2447 | 2463 |
2448 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { | 2464 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { |
2449 info()->MarkAsRequiresFrame(); | 2465 info()->MarkAsRequiresFrame(); |
2450 LOperand* args = UseRegister(instr->arguments()); | 2466 LOperand* args = UseRegister(instr->arguments()); |
2451 LOperand* length; | 2467 LOperand* length; |
2452 LOperand* index; | 2468 LOperand* index; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2589 | 2605 |
2590 | 2606 |
2591 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2607 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2592 LOperand* object = UseRegister(instr->object()); | 2608 LOperand* object = UseRegister(instr->object()); |
2593 LOperand* index = UseRegister(instr->index()); | 2609 LOperand* index = UseRegister(instr->index()); |
2594 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2610 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2595 } | 2611 } |
2596 | 2612 |
2597 | 2613 |
2598 } } // namespace v8::internal | 2614 } } // namespace v8::internal |
OLD | NEW |