| 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 6011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6022 } | 6022 } |
| 6023 } | 6023 } |
| 6024 | 6024 |
| 6025 | 6025 |
| 6026 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 6026 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
| 6027 // Use the fast case closure allocation code that allocates in new | 6027 // Use the fast case closure allocation code that allocates in new |
| 6028 // space for nested functions that don't need literals cloning. | 6028 // space for nested functions that don't need literals cloning. |
| 6029 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); | 6029 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); |
| 6030 bool pretenure = instr->hydrogen()->pretenure(); | 6030 bool pretenure = instr->hydrogen()->pretenure(); |
| 6031 if (!pretenure && shared_info->num_literals() == 0) { | 6031 if (!pretenure && shared_info->num_literals() == 0) { |
| 6032 FastNewClosureStub stub(shared_info->language_mode()); | 6032 FastNewClosureStub stub(shared_info->language_mode(), |
| 6033 shared_info->is_generator()); |
| 6033 __ mov(r1, Operand(shared_info)); | 6034 __ mov(r1, Operand(shared_info)); |
| 6034 __ push(r1); | 6035 __ push(r1); |
| 6035 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 6036 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 6036 } else { | 6037 } else { |
| 6037 __ mov(r2, Operand(shared_info)); | 6038 __ mov(r2, Operand(shared_info)); |
| 6038 __ mov(r1, Operand(pretenure | 6039 __ mov(r1, Operand(pretenure |
| 6039 ? factory()->true_value() | 6040 ? factory()->true_value() |
| 6040 : factory()->false_value())); | 6041 : factory()->false_value())); |
| 6041 __ Push(cp, r2, r1); | 6042 __ Push(cp, r2, r1); |
| 6042 CallRuntime(Runtime::kNewClosure, 3, instr); | 6043 CallRuntime(Runtime::kNewClosure, 3, instr); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6406 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6407 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 6407 __ ldr(result, FieldMemOperand(scratch, | 6408 __ ldr(result, FieldMemOperand(scratch, |
| 6408 FixedArray::kHeaderSize - kPointerSize)); | 6409 FixedArray::kHeaderSize - kPointerSize)); |
| 6409 __ bind(&done); | 6410 __ bind(&done); |
| 6410 } | 6411 } |
| 6411 | 6412 |
| 6412 | 6413 |
| 6413 #undef __ | 6414 #undef __ |
| 6414 | 6415 |
| 6415 } } // namespace v8::internal | 6416 } } // namespace v8::internal |
| OLD | NEW |