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 5444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5455 __ sw(a3, FieldMemOperand(v0, i)); | 5455 __ sw(a3, FieldMemOperand(v0, i)); |
5456 __ sw(a2, FieldMemOperand(v0, i + kPointerSize)); | 5456 __ sw(a2, FieldMemOperand(v0, i + kPointerSize)); |
5457 } | 5457 } |
5458 if ((size % (2 * kPointerSize)) != 0) { | 5458 if ((size % (2 * kPointerSize)) != 0) { |
5459 __ lw(a3, FieldMemOperand(a1, size - kPointerSize)); | 5459 __ lw(a3, FieldMemOperand(a1, size - kPointerSize)); |
5460 __ sw(a3, FieldMemOperand(v0, size - kPointerSize)); | 5460 __ sw(a3, FieldMemOperand(v0, size - kPointerSize)); |
5461 } | 5461 } |
5462 } | 5462 } |
5463 | 5463 |
5464 | 5464 |
5465 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | |
5466 DCHECK(ToRegister(instr->context()).is(cp)); | |
5467 // Use the fast case closure allocation code that allocates in new | |
5468 // space for nested functions that don't need literals cloning. | |
5469 bool pretenure = instr->hydrogen()->pretenure(); | |
5470 if (!pretenure && instr->hydrogen()->has_no_literals()) { | |
5471 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(), | |
5472 instr->hydrogen()->kind()); | |
5473 __ li(a2, Operand(instr->hydrogen()->shared_info())); | |
5474 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
5475 } else { | |
5476 __ li(a2, Operand(instr->hydrogen()->shared_info())); | |
5477 __ li(a1, Operand(pretenure ? factory()->true_value() | |
5478 : factory()->false_value())); | |
5479 __ Push(cp, a2, a1); | |
5480 CallRuntime(Runtime::kNewClosure, 3, instr); | |
5481 } | |
5482 } | |
5483 | |
5484 | |
5485 void LCodeGen::DoTypeof(LTypeof* instr) { | 5465 void LCodeGen::DoTypeof(LTypeof* instr) { |
5486 DCHECK(ToRegister(instr->value()).is(a3)); | 5466 DCHECK(ToRegister(instr->value()).is(a3)); |
5487 DCHECK(ToRegister(instr->result()).is(v0)); | 5467 DCHECK(ToRegister(instr->result()).is(v0)); |
5488 Label end, do_call; | 5468 Label end, do_call; |
5489 Register value_register = ToRegister(instr->value()); | 5469 Register value_register = ToRegister(instr->value()); |
5490 __ JumpIfNotSmi(value_register, &do_call); | 5470 __ JumpIfNotSmi(value_register, &do_call); |
5491 __ li(v0, Operand(isolate()->factory()->number_string())); | 5471 __ li(v0, Operand(isolate()->factory()->number_string())); |
5492 __ jmp(&end); | 5472 __ jmp(&end); |
5493 __ bind(&do_call); | 5473 __ bind(&do_call); |
5494 TypeofStub stub(isolate()); | 5474 TypeofStub stub(isolate()); |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5924 __ Push(at, ToRegister(instr->function())); | 5904 __ Push(at, ToRegister(instr->function())); |
5925 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5905 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5926 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5906 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5927 } | 5907 } |
5928 | 5908 |
5929 | 5909 |
5930 #undef __ | 5910 #undef __ |
5931 | 5911 |
5932 } // namespace internal | 5912 } // namespace internal |
5933 } // namespace v8 | 5913 } // namespace v8 |
OLD | NEW |