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 4295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4306 } | 4306 } |
4307 | 4307 |
4308 | 4308 |
4309 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 4309 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
4310 ASSERT(ToRegister(instr->context()).is(esi)); | 4310 ASSERT(ToRegister(instr->context()).is(esi)); |
4311 // Use the fast case closure allocation code that allocates in new | 4311 // Use the fast case closure allocation code that allocates in new |
4312 // space for nested functions that don't need literals cloning. | 4312 // space for nested functions that don't need literals cloning. |
4313 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); | 4313 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); |
4314 bool pretenure = instr->hydrogen()->pretenure(); | 4314 bool pretenure = instr->hydrogen()->pretenure(); |
4315 if (!pretenure && shared_info->num_literals() == 0) { | 4315 if (!pretenure && shared_info->num_literals() == 0) { |
4316 FastNewClosureStub stub( | 4316 FastNewClosureStub stub(shared_info->strict_mode_flag()); |
4317 shared_info->strict_mode() ? kStrictMode : kNonStrictMode); | |
4318 __ push(Immediate(shared_info)); | 4317 __ push(Immediate(shared_info)); |
4319 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4318 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4320 } else { | 4319 } else { |
4321 __ push(Operand(ebp, StandardFrameConstants::kContextOffset)); | 4320 __ push(Operand(ebp, StandardFrameConstants::kContextOffset)); |
4322 __ push(Immediate(shared_info)); | 4321 __ push(Immediate(shared_info)); |
4323 __ push(Immediate(pretenure | 4322 __ push(Immediate(pretenure |
4324 ? factory()->true_value() | 4323 ? factory()->true_value() |
4325 : factory()->false_value())); | 4324 : factory()->false_value())); |
4326 CallRuntime(Runtime::kNewClosure, 3, instr); | 4325 CallRuntime(Runtime::kNewClosure, 3, instr); |
4327 } | 4326 } |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4584 env->deoptimization_index()); | 4583 env->deoptimization_index()); |
4585 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4584 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4586 } | 4585 } |
4587 | 4586 |
4588 | 4587 |
4589 #undef __ | 4588 #undef __ |
4590 | 4589 |
4591 } } // namespace v8::internal | 4590 } } // namespace v8::internal |
4592 | 4591 |
4593 #endif // V8_TARGET_ARCH_IA32 | 4592 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |