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 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3250 } | 3250 } |
3251 } | 3251 } |
3252 | 3252 |
3253 // Fast-case: Invoke the function now. | 3253 // Fast-case: Invoke the function now. |
3254 // a1: pushed function | 3254 // a1: pushed function |
3255 ParameterCount actual(argc_); | 3255 ParameterCount actual(argc_); |
3256 | 3256 |
3257 if (CallAsMethod()) { | 3257 if (CallAsMethod()) { |
3258 if (NeedsChecks()) { | 3258 if (NeedsChecks()) { |
3259 // Do not transform the receiver for strict mode functions and natives. | 3259 // Do not transform the receiver for strict mode functions and natives. |
3260 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 3260 __ lw(a3, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
3261 __ lw(a3, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset)); | 3261 __ lw(a4, FieldMemOperand(a3, SharedFunctionInfo::kCompilerHintsOffset)); |
3262 int32_t strict_mode_function_mask = | 3262 int32_t strict_mode_function_mask = |
3263 1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize); | 3263 1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize); |
3264 int32_t native_mask = 1 << (SharedFunctionInfo::kNative + kSmiTagSize); | 3264 int32_t native_mask = 1 << (SharedFunctionInfo::kNative + kSmiTagSize); |
3265 __ And(at, a3, Operand(strict_mode_function_mask | native_mask)); | 3265 __ And(at, a4, Operand(strict_mode_function_mask | native_mask)); |
3266 __ Branch(&cont, ne, at, Operand(zero_reg)); | 3266 __ Branch(&cont, ne, at, Operand(zero_reg)); |
3267 } | 3267 } |
3268 | 3268 |
3269 // Compute the receiver in non-strict mode. | 3269 // Compute the receiver in non-strict mode. |
3270 __ lw(a2, MemOperand(sp, argc_ * kPointerSize)); | 3270 __ lw(a3, MemOperand(sp, argc_ * kPointerSize)); |
3271 | 3271 |
3272 if (NeedsChecks()) { | 3272 if (NeedsChecks()) { |
3273 // a0: actual number of arguments | 3273 __ JumpIfSmi(a3, &wrap); |
3274 // a1: function | 3274 __ GetObjectType(a3, a4, a4); |
3275 // a2: first argument | 3275 __ Branch(&wrap, lt, a4, Operand(FIRST_SPEC_OBJECT_TYPE)); |
3276 __ JumpIfSmi(a2, &wrap); | |
3277 __ GetObjectType(a2, a3, a3); | |
3278 __ Branch(&wrap, lt, a3, Operand(FIRST_SPEC_OBJECT_TYPE)); | |
3279 } else { | 3276 } else { |
3280 __ jmp(&wrap); | 3277 __ jmp(&wrap); |
3281 } | 3278 } |
3282 | 3279 |
3283 __ bind(&cont); | 3280 __ bind(&cont); |
3284 } | 3281 } |
3285 __ InvokeFunction(a1, actual, JUMP_FUNCTION, NullCallWrapper()); | 3282 __ InvokeFunction(a1, actual, JUMP_FUNCTION, NullCallWrapper()); |
3286 | 3283 |
3287 if (NeedsChecks()) { | 3284 if (NeedsChecks()) { |
3288 // Slow-case: Non-function called. | 3285 // Slow-case: Non-function called. |
(...skipping 27 matching lines...) Expand all Loading... |
3316 __ li(a2, Operand(0, RelocInfo::NONE32)); | 3313 __ li(a2, Operand(0, RelocInfo::NONE32)); |
3317 __ GetBuiltinFunction(a1, Builtins::CALL_NON_FUNCTION); | 3314 __ GetBuiltinFunction(a1, Builtins::CALL_NON_FUNCTION); |
3318 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 3315 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
3319 RelocInfo::CODE_TARGET); | 3316 RelocInfo::CODE_TARGET); |
3320 } | 3317 } |
3321 | 3318 |
3322 if (CallAsMethod()) { | 3319 if (CallAsMethod()) { |
3323 __ bind(&wrap); | 3320 __ bind(&wrap); |
3324 // Wrap the receiver and patch it back onto the stack. | 3321 // Wrap the receiver and patch it back onto the stack. |
3325 { FrameScope frame_scope(masm, StackFrame::INTERNAL); | 3322 { FrameScope frame_scope(masm, StackFrame::INTERNAL); |
3326 __ Push(a1, a2); | 3323 __ Push(a1, a3); |
3327 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 3324 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
3328 __ pop(a1); | 3325 __ pop(a1); |
3329 } | 3326 } |
3330 __ mov(a0, v0); | 3327 __ mov(a0, v0); |
3331 __ sw(a0, MemOperand(sp, argc_ * kPointerSize)); | 3328 __ sw(a0, MemOperand(sp, argc_ * kPointerSize)); |
3332 __ jmp(&cont); | 3329 __ jmp(&cont); |
3333 } | 3330 } |
3334 } | 3331 } |
3335 | 3332 |
3336 | 3333 |
(...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5727 MemOperand(fp, 6 * kPointerSize), | 5724 MemOperand(fp, 6 * kPointerSize), |
5728 NULL); | 5725 NULL); |
5729 } | 5726 } |
5730 | 5727 |
5731 | 5728 |
5732 #undef __ | 5729 #undef __ |
5733 | 5730 |
5734 } } // namespace v8::internal | 5731 } } // namespace v8::internal |
5735 | 5732 |
5736 #endif // V8_TARGET_ARCH_MIPS | 5733 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |