OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3640 __ str(r3, FieldMemOperand(r0, size - kPointerSize)); | 3640 __ str(r3, FieldMemOperand(r0, size - kPointerSize)); |
3641 } | 3641 } |
3642 } | 3642 } |
3643 | 3643 |
3644 | 3644 |
3645 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 3645 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
3646 // Use the fast case closure allocation code that allocates in new | 3646 // Use the fast case closure allocation code that allocates in new |
3647 // space for nested functions that don't need literals cloning. | 3647 // space for nested functions that don't need literals cloning. |
3648 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); | 3648 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); |
3649 bool pretenure = instr->hydrogen()->pretenure(); | 3649 bool pretenure = instr->hydrogen()->pretenure(); |
3650 if (shared_info->num_literals() == 0 && !pretenure) { | 3650 if (!pretenure && shared_info->num_literals() == 0 && |
| 3651 !shared_info->strict_mode()) { // Strict mode functions use slow path. |
3651 FastNewClosureStub stub; | 3652 FastNewClosureStub stub; |
3652 __ mov(r1, Operand(shared_info)); | 3653 __ mov(r1, Operand(shared_info)); |
3653 __ push(r1); | 3654 __ push(r1); |
3654 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3655 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3655 } else { | 3656 } else { |
3656 __ mov(r2, Operand(shared_info)); | 3657 __ mov(r2, Operand(shared_info)); |
3657 __ mov(r1, Operand(pretenure | 3658 __ mov(r1, Operand(pretenure |
3658 ? Factory::true_value() | 3659 ? Factory::true_value() |
3659 : Factory::false_value())); | 3660 : Factory::false_value())); |
3660 __ Push(cp, r2, r1); | 3661 __ Push(cp, r2, r1); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3877 ASSERT(!environment->HasBeenRegistered()); | 3878 ASSERT(!environment->HasBeenRegistered()); |
3878 RegisterEnvironmentForDeoptimization(environment); | 3879 RegisterEnvironmentForDeoptimization(environment); |
3879 ASSERT(osr_pc_offset_ == -1); | 3880 ASSERT(osr_pc_offset_ == -1); |
3880 osr_pc_offset_ = masm()->pc_offset(); | 3881 osr_pc_offset_ = masm()->pc_offset(); |
3881 } | 3882 } |
3882 | 3883 |
3883 | 3884 |
3884 #undef __ | 3885 #undef __ |
3885 | 3886 |
3886 } } // namespace v8::internal | 3887 } } // namespace v8::internal |
OLD | NEW |