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 3486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3497 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { | 3497 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
3498 ASSERT(ToRegister(instr->context()).is(cp)); | 3498 ASSERT(ToRegister(instr->context()).is(cp)); |
3499 __ li(scratch0(), instr->hydrogen()->pairs()); | 3499 __ li(scratch0(), instr->hydrogen()->pairs()); |
3500 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); | 3500 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); |
3501 // The context is the first argument. | 3501 // The context is the first argument. |
3502 __ Push(cp, scratch0(), scratch1()); | 3502 __ Push(cp, scratch0(), scratch1()); |
3503 CallRuntime(Runtime::kDeclareGlobals, 3, instr); | 3503 CallRuntime(Runtime::kDeclareGlobals, 3, instr); |
3504 } | 3504 } |
3505 | 3505 |
3506 | 3506 |
3507 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { | |
3508 Register context = ToRegister(instr->context()); | |
3509 Register result = ToRegister(instr->result()); | |
3510 __ lw(result, ContextOperand(context, Context::GLOBAL_OBJECT_INDEX)); | |
3511 } | |
3512 | |
3513 | |
3514 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { | |
3515 Register global = ToRegister(instr->global_object()); | |
3516 Register result = ToRegister(instr->result()); | |
3517 __ lw(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset)); | |
3518 } | |
3519 | |
3520 | |
3521 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, | 3507 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
3522 int formal_parameter_count, | 3508 int formal_parameter_count, |
3523 int arity, | 3509 int arity, |
3524 LInstruction* instr, | 3510 LInstruction* instr, |
3525 A1State a1_state) { | 3511 A1State a1_state) { |
3526 bool dont_adapt_arguments = | 3512 bool dont_adapt_arguments = |
3527 formal_parameter_count == SharedFunctionInfo::kDontAdaptArgumentsSentinel; | 3513 formal_parameter_count == SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
3528 bool can_invoke_directly = | 3514 bool can_invoke_directly = |
3529 dont_adapt_arguments || formal_parameter_count == arity; | 3515 dont_adapt_arguments || formal_parameter_count == arity; |
3530 | 3516 |
(...skipping 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5808 __ Subu(scratch, result, scratch); | 5794 __ Subu(scratch, result, scratch); |
5809 __ lw(result, FieldMemOperand(scratch, | 5795 __ lw(result, FieldMemOperand(scratch, |
5810 FixedArray::kHeaderSize - kPointerSize)); | 5796 FixedArray::kHeaderSize - kPointerSize)); |
5811 __ bind(&done); | 5797 __ bind(&done); |
5812 } | 5798 } |
5813 | 5799 |
5814 | 5800 |
5815 #undef __ | 5801 #undef __ |
5816 | 5802 |
5817 } } // namespace v8::internal | 5803 } } // namespace v8::internal |
OLD | NEW |