OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 5435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5446 } | 5446 } |
5447 } | 5447 } |
5448 | 5448 |
5449 | 5449 |
5450 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 5450 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
5451 DCHECK(ToRegister(instr->context()).is(cp)); | 5451 DCHECK(ToRegister(instr->context()).is(cp)); |
5452 // Use the fast case closure allocation code that allocates in new | 5452 // Use the fast case closure allocation code that allocates in new |
5453 // space for nested functions that don't need literals cloning. | 5453 // space for nested functions that don't need literals cloning. |
5454 bool pretenure = instr->hydrogen()->pretenure(); | 5454 bool pretenure = instr->hydrogen()->pretenure(); |
5455 if (!pretenure && instr->hydrogen()->has_no_literals()) { | 5455 if (!pretenure && instr->hydrogen()->has_no_literals()) { |
5456 FastNewClosureStub stub(isolate(), | 5456 FastNewClosureStub stub(isolate(), instr->hydrogen()->strict_mode(), |
5457 instr->hydrogen()->strict_mode(), | 5457 instr->hydrogen()->is_generator(), |
5458 instr->hydrogen()->is_generator()); | 5458 instr->hydrogen()->is_concise_method()); |
5459 __ li(a2, Operand(instr->hydrogen()->shared_info())); | 5459 __ li(a2, Operand(instr->hydrogen()->shared_info())); |
5460 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 5460 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
5461 } else { | 5461 } else { |
5462 __ li(a2, Operand(instr->hydrogen()->shared_info())); | 5462 __ li(a2, Operand(instr->hydrogen()->shared_info())); |
5463 __ li(a1, Operand(pretenure ? factory()->true_value() | 5463 __ li(a1, Operand(pretenure ? factory()->true_value() |
5464 : factory()->false_value())); | 5464 : factory()->false_value())); |
5465 __ Push(cp, a2, a1); | 5465 __ Push(cp, a2, a1); |
5466 CallRuntime(Runtime::kNewClosure, 3, instr); | 5466 CallRuntime(Runtime::kNewClosure, 3, instr); |
5467 } | 5467 } |
5468 } | 5468 } |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5901 __ li(at, scope_info); | 5901 __ li(at, scope_info); |
5902 __ Push(at, ToRegister(instr->function())); | 5902 __ Push(at, ToRegister(instr->function())); |
5903 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5903 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5904 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5904 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5905 } | 5905 } |
5906 | 5906 |
5907 | 5907 |
5908 #undef __ | 5908 #undef __ |
5909 | 5909 |
5910 } } // namespace v8::internal | 5910 } } // namespace v8::internal |
OLD | NEW |