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 3503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3514 // If there is no frame, the context must be in cp. | 3514 // If there is no frame, the context must be in cp. |
3515 DCHECK(result.is(cp)); | 3515 DCHECK(result.is(cp)); |
3516 } | 3516 } |
3517 } | 3517 } |
3518 | 3518 |
3519 | 3519 |
3520 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { | 3520 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
3521 DCHECK(ToRegister(instr->context()).is(cp)); | 3521 DCHECK(ToRegister(instr->context()).is(cp)); |
3522 __ li(scratch0(), instr->hydrogen()->pairs()); | 3522 __ li(scratch0(), instr->hydrogen()->pairs()); |
3523 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); | 3523 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); |
3524 // The context is the first argument. | 3524 __ Push(scratch0(), scratch1()); |
3525 __ Push(cp, scratch0(), scratch1()); | 3525 CallRuntime(Runtime::kDeclareGlobals, 2, instr); |
3526 CallRuntime(Runtime::kDeclareGlobals, 3, instr); | |
3527 } | 3526 } |
3528 | 3527 |
3529 | 3528 |
3530 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, | 3529 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
3531 int formal_parameter_count, int arity, | 3530 int formal_parameter_count, int arity, |
3532 LInstruction* instr) { | 3531 LInstruction* instr) { |
3533 bool dont_adapt_arguments = | 3532 bool dont_adapt_arguments = |
3534 formal_parameter_count == SharedFunctionInfo::kDontAdaptArgumentsSentinel; | 3533 formal_parameter_count == SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
3535 bool can_invoke_directly = | 3534 bool can_invoke_directly = |
3536 dont_adapt_arguments || formal_parameter_count == arity; | 3535 dont_adapt_arguments || formal_parameter_count == arity; |
(...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6060 __ Push(at, ToRegister(instr->function())); | 6059 __ Push(at, ToRegister(instr->function())); |
6061 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6060 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6062 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6061 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6063 } | 6062 } |
6064 | 6063 |
6065 | 6064 |
6066 #undef __ | 6065 #undef __ |
6067 | 6066 |
6068 } // namespace internal | 6067 } // namespace internal |
6069 } // namespace v8 | 6068 } // namespace v8 |
OLD | NEW |