| 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 5472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5483 } | 5483 } |
| 5484 } | 5484 } |
| 5485 | 5485 |
| 5486 | 5486 |
| 5487 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 5487 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
| 5488 // Use the fast case closure allocation code that allocates in new | 5488 // Use the fast case closure allocation code that allocates in new |
| 5489 // space for nested functions that don't need literals cloning. | 5489 // space for nested functions that don't need literals cloning. |
| 5490 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); | 5490 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); |
| 5491 bool pretenure = instr->hydrogen()->pretenure(); | 5491 bool pretenure = instr->hydrogen()->pretenure(); |
| 5492 if (!pretenure && shared_info->num_literals() == 0) { | 5492 if (!pretenure && shared_info->num_literals() == 0) { |
| 5493 FastNewClosureStub stub(shared_info->language_mode()); | 5493 FastNewClosureStub stub(shared_info->language_mode(), |
| 5494 shared_info->is_generator()); |
| 5494 __ li(a1, Operand(shared_info)); | 5495 __ li(a1, Operand(shared_info)); |
| 5495 __ push(a1); | 5496 __ push(a1); |
| 5496 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5497 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 5497 } else { | 5498 } else { |
| 5498 __ li(a2, Operand(shared_info)); | 5499 __ li(a2, Operand(shared_info)); |
| 5499 __ li(a1, Operand(pretenure | 5500 __ li(a1, Operand(pretenure |
| 5500 ? factory()->true_value() | 5501 ? factory()->true_value() |
| 5501 : factory()->false_value())); | 5502 : factory()->false_value())); |
| 5502 __ Push(cp, a2, a1); | 5503 __ Push(cp, a2, a1); |
| 5503 CallRuntime(Runtime::kNewClosure, 3, instr); | 5504 CallRuntime(Runtime::kNewClosure, 3, instr); |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5899 __ Subu(scratch, result, scratch); | 5900 __ Subu(scratch, result, scratch); |
| 5900 __ lw(result, FieldMemOperand(scratch, | 5901 __ lw(result, FieldMemOperand(scratch, |
| 5901 FixedArray::kHeaderSize - kPointerSize)); | 5902 FixedArray::kHeaderSize - kPointerSize)); |
| 5902 __ bind(&done); | 5903 __ bind(&done); |
| 5903 } | 5904 } |
| 5904 | 5905 |
| 5905 | 5906 |
| 5906 #undef __ | 5907 #undef __ |
| 5907 | 5908 |
| 5908 } } // namespace v8::internal | 5909 } } // namespace v8::internal |
| OLD | NEW |