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 3476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3487 Register result = ToRegister(instr->result()); | 3487 Register result = ToRegister(instr->result()); |
3488 if (info()->IsOptimizing()) { | 3488 if (info()->IsOptimizing()) { |
3489 __ lw(result, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3489 __ lw(result, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3490 } else { | 3490 } else { |
3491 // If there is no frame, the context must be in cp. | 3491 // If there is no frame, the context must be in cp. |
3492 ASSERT(result.is(cp)); | 3492 ASSERT(result.is(cp)); |
3493 } | 3493 } |
3494 } | 3494 } |
3495 | 3495 |
3496 | 3496 |
3497 void LCodeGen::DoOuterContext(LOuterContext* instr) { | |
3498 Register context = ToRegister(instr->context()); | |
3499 Register result = ToRegister(instr->result()); | |
3500 __ lw(result, | |
3501 MemOperand(context, Context::SlotOffset(Context::PREVIOUS_INDEX))); | |
3502 } | |
3503 | |
3504 | |
3505 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { | 3497 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
3506 ASSERT(ToRegister(instr->context()).is(cp)); | 3498 ASSERT(ToRegister(instr->context()).is(cp)); |
3507 __ li(scratch0(), instr->hydrogen()->pairs()); | 3499 __ li(scratch0(), instr->hydrogen()->pairs()); |
3508 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); | 3500 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); |
3509 // The context is the first argument. | 3501 // The context is the first argument. |
3510 __ Push(cp, scratch0(), scratch1()); | 3502 __ Push(cp, scratch0(), scratch1()); |
3511 CallRuntime(Runtime::kDeclareGlobals, 3, instr); | 3503 CallRuntime(Runtime::kDeclareGlobals, 3, instr); |
3512 } | 3504 } |
3513 | 3505 |
3514 | 3506 |
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5816 __ Subu(scratch, result, scratch); | 5808 __ Subu(scratch, result, scratch); |
5817 __ lw(result, FieldMemOperand(scratch, | 5809 __ lw(result, FieldMemOperand(scratch, |
5818 FixedArray::kHeaderSize - kPointerSize)); | 5810 FixedArray::kHeaderSize - kPointerSize)); |
5819 __ bind(&done); | 5811 __ bind(&done); |
5820 } | 5812 } |
5821 | 5813 |
5822 | 5814 |
5823 #undef __ | 5815 #undef __ |
5824 | 5816 |
5825 } } // namespace v8::internal | 5817 } } // namespace v8::internal |
OLD | NEW |