| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 4425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4436 deferred->Branch(equal); | 4436 deferred->Branch(equal); |
| 4437 deferred->BindExit(); | 4437 deferred->BindExit(); |
| 4438 literals.Unuse(); | 4438 literals.Unuse(); |
| 4439 | 4439 |
| 4440 // Push the resulting array literal boilerplate on the stack. | 4440 // Push the resulting array literal boilerplate on the stack. |
| 4441 frame_->Push(&boilerplate); | 4441 frame_->Push(&boilerplate); |
| 4442 | 4442 |
| 4443 // Clone the boilerplate object. | 4443 // Clone the boilerplate object. |
| 4444 int length = node->values()->length(); | 4444 int length = node->values()->length(); |
| 4445 Result clone; | 4445 Result clone; |
| 4446 if (node->depth() == 1 && | 4446 if (node->depth() == 1) { |
| 4447 length <= FastCloneShallowArrayStub::kMaximumLength) { | 4447 if (length <= FastCloneShallowArrayStub::kMaximumLength) { |
| 4448 FastCloneShallowArrayStub stub(length); | 4448 FastCloneShallowArrayStub stub(length); |
| 4449 clone = frame_->CallStub(&stub, 1); | 4449 clone = frame_->CallStub(&stub, 1); |
| 4450 } else { |
| 4451 clone = frame_->CallRuntime(Runtime::kCloneShallowLiteralBoilerplate, 1); |
| 4452 } |
| 4450 } else { | 4453 } else { |
| 4451 clone = frame_->CallRuntime(Runtime::kCloneLiteralBoilerplate, 1); | 4454 clone = frame_->CallRuntime(Runtime::kCloneLiteralBoilerplate, 1); |
| 4452 } | 4455 } |
| 4453 // Push the newly cloned literal object as the result. | 4456 // Push the newly cloned literal object as the result. |
| 4454 frame_->Push(&clone); | 4457 frame_->Push(&clone); |
| 4455 | 4458 |
| 4456 // Generate code to set the elements in the array that are not | 4459 // Generate code to set the elements in the array that are not |
| 4457 // literals. | 4460 // literals. |
| 4458 for (int i = 0; i < length; i++) { | 4461 for (int i = 0; i < length; i++) { |
| 4459 Expression* value = node->values()->at(i); | 4462 Expression* value = node->values()->at(i); |
| (...skipping 4337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8797 __ add(Operand(dest), Immediate(2)); | 8800 __ add(Operand(dest), Immediate(2)); |
| 8798 } | 8801 } |
| 8799 __ sub(Operand(count), Immediate(1)); | 8802 __ sub(Operand(count), Immediate(1)); |
| 8800 __ j(not_zero, &loop); | 8803 __ j(not_zero, &loop); |
| 8801 } | 8804 } |
| 8802 | 8805 |
| 8803 | 8806 |
| 8804 #undef __ | 8807 #undef __ |
| 8805 | 8808 |
| 8806 } } // namespace v8::internal | 8809 } } // namespace v8::internal |
| OLD | NEW |