| 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 5911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5922 } | 5922 } |
| 5923 } | 5923 } |
| 5924 | 5924 |
| 5925 | 5925 |
| 5926 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 5926 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
| 5927 ASSERT(ToRegister(instr->context()).is(esi)); | 5927 ASSERT(ToRegister(instr->context()).is(esi)); |
| 5928 // Use the fast case closure allocation code that allocates in new | 5928 // Use the fast case closure allocation code that allocates in new |
| 5929 // space for nested functions that don't need literals cloning. | 5929 // space for nested functions that don't need literals cloning. |
| 5930 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); | 5930 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); |
| 5931 bool pretenure = instr->hydrogen()->pretenure(); | 5931 bool pretenure = instr->hydrogen()->pretenure(); |
| 5932 if (!pretenure && shared_info->num_literals() == 0) { | 5932 if (!pretenure && |
| 5933 shared_info->num_literals() == 0 && |
| 5934 !shared_info->is_generator()) { |
| 5933 FastNewClosureStub stub(shared_info->language_mode()); | 5935 FastNewClosureStub stub(shared_info->language_mode()); |
| 5934 __ push(Immediate(shared_info)); | 5936 __ push(Immediate(shared_info)); |
| 5935 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5937 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 5936 } else { | 5938 } else { |
| 5937 __ push(esi); | 5939 __ push(esi); |
| 5938 __ push(Immediate(shared_info)); | 5940 __ push(Immediate(shared_info)); |
| 5939 __ push(Immediate(pretenure | 5941 __ push(Immediate(pretenure |
| 5940 ? factory()->true_value() | 5942 ? factory()->true_value() |
| 5941 : factory()->false_value())); | 5943 : factory()->false_value())); |
| 5942 CallRuntime(Runtime::kNewClosure, 3, instr); | 5944 CallRuntime(Runtime::kNewClosure, 3, instr); |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6299 FixedArray::kHeaderSize - kPointerSize)); | 6301 FixedArray::kHeaderSize - kPointerSize)); |
| 6300 __ bind(&done); | 6302 __ bind(&done); |
| 6301 } | 6303 } |
| 6302 | 6304 |
| 6303 | 6305 |
| 6304 #undef __ | 6306 #undef __ |
| 6305 | 6307 |
| 6306 } } // namespace v8::internal | 6308 } } // namespace v8::internal |
| 6307 | 6309 |
| 6308 #endif // V8_TARGET_ARCH_IA32 | 6310 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |