| 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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 ASSERT(depth2 == kInvalidProtoDepth); | 947 ASSERT(depth2 == kInvalidProtoDepth); |
| 948 } | 948 } |
| 949 | 949 |
| 950 // Invoke function. | 950 // Invoke function. |
| 951 if (can_do_fast_api_call) { | 951 if (can_do_fast_api_call) { |
| 952 GenerateFastApiDirectCall(masm, optimization, arguments_.immediate()); | 952 GenerateFastApiDirectCall(masm, optimization, arguments_.immediate()); |
| 953 } else { | 953 } else { |
| 954 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_) | 954 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_) |
| 955 ? CALL_AS_FUNCTION | 955 ? CALL_AS_FUNCTION |
| 956 : CALL_AS_METHOD; | 956 : CALL_AS_METHOD; |
| 957 Handle<JSFunction> fun = optimization.constant_function(); | 957 Handle<JSFunction> function = optimization.constant_function(); |
| 958 __ InvokeFunction(fun, ParameterCount(fun), arguments_, | 958 ParameterCount expected(function); |
| 959 __ InvokeFunction(function, expected, arguments_, |
| 959 JUMP_FUNCTION, NullCallWrapper(), call_kind); | 960 JUMP_FUNCTION, NullCallWrapper(), call_kind); |
| 960 } | 961 } |
| 961 | 962 |
| 962 // Deferred code for fast API call case---clean preallocated space. | 963 // Deferred code for fast API call case---clean preallocated space. |
| 963 if (can_do_fast_api_call) { | 964 if (can_do_fast_api_call) { |
| 964 __ bind(&miss_cleanup); | 965 __ bind(&miss_cleanup); |
| 965 FreeSpaceForFastApiCall(masm); | 966 FreeSpaceForFastApiCall(masm); |
| 966 __ b(miss_label); | 967 __ b(miss_label); |
| 967 } | 968 } |
| 968 | 969 |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2078 generator.GenerateFast(masm()); | 2079 generator.GenerateFast(masm()); |
| 2079 __ Drop(argc + 1); | 2080 __ Drop(argc + 1); |
| 2080 __ Ret(); | 2081 __ Ret(); |
| 2081 | 2082 |
| 2082 StubRuntimeCallHelper call_helper; | 2083 StubRuntimeCallHelper call_helper; |
| 2083 generator.GenerateSlow(masm(), call_helper); | 2084 generator.GenerateSlow(masm(), call_helper); |
| 2084 | 2085 |
| 2085 // Tail call the full function. We do not have to patch the receiver | 2086 // Tail call the full function. We do not have to patch the receiver |
| 2086 // because the function makes no use of it. | 2087 // because the function makes no use of it. |
| 2087 __ bind(&slow); | 2088 __ bind(&slow); |
| 2088 __ InvokeFunction(function, ParameterCount(function), arguments(), | 2089 ParameterCount expected(function); |
| 2090 __ InvokeFunction(function, expected, arguments(), |
| 2089 JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); | 2091 JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
| 2090 | 2092 |
| 2091 __ bind(&miss); | 2093 __ bind(&miss); |
| 2092 // r2: function name. | 2094 // r2: function name. |
| 2093 GenerateMissBranch(); | 2095 GenerateMissBranch(); |
| 2094 | 2096 |
| 2095 // Return the generated code. | 2097 // Return the generated code. |
| 2096 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); | 2098 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
| 2097 } | 2099 } |
| 2098 | 2100 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 // Tag the result. | 2191 // Tag the result. |
| 2190 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 2192 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
| 2191 | 2193 |
| 2192 __ bind(&just_return); | 2194 __ bind(&just_return); |
| 2193 __ Drop(argc + 1); | 2195 __ Drop(argc + 1); |
| 2194 __ Ret(); | 2196 __ Ret(); |
| 2195 | 2197 |
| 2196 __ bind(&slow); | 2198 __ bind(&slow); |
| 2197 // Tail call the full function. We do not have to patch the receiver | 2199 // Tail call the full function. We do not have to patch the receiver |
| 2198 // because the function makes no use of it. | 2200 // because the function makes no use of it. |
| 2199 __ InvokeFunction(function, ParameterCount(function), arguments(), | 2201 ParameterCount expected(fun); |
| 2202 __ InvokeFunction(function, expected, arguments(), |
| 2200 JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); | 2203 JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
| 2201 | 2204 |
| 2202 __ bind(&miss); | 2205 __ bind(&miss); |
| 2203 // r2: function name. | 2206 // r2: function name. |
| 2204 GenerateMissBranch(); | 2207 GenerateMissBranch(); |
| 2205 | 2208 |
| 2206 // Return the generated code. | 2209 // Return the generated code. |
| 2207 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); | 2210 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
| 2208 } | 2211 } |
| 2209 | 2212 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2288 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); | 2291 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); |
| 2289 __ AllocateHeapNumber(r0, r4, r5, r6, &slow); | 2292 __ AllocateHeapNumber(r0, r4, r5, r6, &slow); |
| 2290 __ str(r1, FieldMemOperand(r0, HeapNumber::kExponentOffset)); | 2293 __ str(r1, FieldMemOperand(r0, HeapNumber::kExponentOffset)); |
| 2291 __ str(r3, FieldMemOperand(r0, HeapNumber::kMantissaOffset)); | 2294 __ str(r3, FieldMemOperand(r0, HeapNumber::kMantissaOffset)); |
| 2292 __ Drop(argc + 1); | 2295 __ Drop(argc + 1); |
| 2293 __ Ret(); | 2296 __ Ret(); |
| 2294 | 2297 |
| 2295 // Tail call the full function. We do not have to patch the receiver | 2298 // Tail call the full function. We do not have to patch the receiver |
| 2296 // because the function makes no use of it. | 2299 // because the function makes no use of it. |
| 2297 __ bind(&slow); | 2300 __ bind(&slow); |
| 2298 __ InvokeFunction(function, ParameterCount(function), arguments(), | 2301 ParameterCount expected(function); |
| 2302 __ InvokeFunction(function, expected, arguments(), |
| 2299 JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); | 2303 JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
| 2300 | 2304 |
| 2301 __ bind(&miss); | 2305 __ bind(&miss); |
| 2302 // r2: function name. | 2306 // r2: function name. |
| 2303 GenerateMissBranch(); | 2307 GenerateMissBranch(); |
| 2304 | 2308 |
| 2305 // Return the generated code. | 2309 // Return the generated code. |
| 2306 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); | 2310 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
| 2307 } | 2311 } |
| 2308 | 2312 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2463 // Handle call cache miss. | 2467 // Handle call cache miss. |
| 2464 __ bind(&miss); | 2468 __ bind(&miss); |
| 2465 GenerateMissBranch(); | 2469 GenerateMissBranch(); |
| 2466 } | 2470 } |
| 2467 | 2471 |
| 2468 | 2472 |
| 2469 void CallStubCompiler::CompileHandlerBackend(Handle<JSFunction> function) { | 2473 void CallStubCompiler::CompileHandlerBackend(Handle<JSFunction> function) { |
| 2470 CallKind call_kind = CallICBase::Contextual::decode(extra_state_) | 2474 CallKind call_kind = CallICBase::Contextual::decode(extra_state_) |
| 2471 ? CALL_AS_FUNCTION | 2475 ? CALL_AS_FUNCTION |
| 2472 : CALL_AS_METHOD; | 2476 : CALL_AS_METHOD; |
| 2473 __ InvokeFunction(function, ParameterCount(function), arguments(), | 2477 ParameterCount expected(function); |
| 2478 __ InvokeFunction(function, expected, arguments(), |
| 2474 JUMP_FUNCTION, NullCallWrapper(), call_kind); | 2479 JUMP_FUNCTION, NullCallWrapper(), call_kind); |
| 2475 } | 2480 } |
| 2476 | 2481 |
| 2477 | 2482 |
| 2478 Handle<Code> CallStubCompiler::CompileCallConstant( | 2483 Handle<Code> CallStubCompiler::CompileCallConstant( |
| 2479 Handle<Object> object, | 2484 Handle<Object> object, |
| 2480 Handle<JSObject> holder, | 2485 Handle<JSObject> holder, |
| 2481 Handle<Name> name, | 2486 Handle<Name> name, |
| 2482 CheckType check, | 2487 CheckType check, |
| 2483 Handle<JSFunction> function) { | 2488 Handle<JSFunction> function) { |
| (...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3662 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3667 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
| 3663 } | 3668 } |
| 3664 } | 3669 } |
| 3665 | 3670 |
| 3666 | 3671 |
| 3667 #undef __ | 3672 #undef __ |
| 3668 | 3673 |
| 3669 } } // namespace v8::internal | 3674 } } // namespace v8::internal |
| 3670 | 3675 |
| 3671 #endif // V8_TARGET_ARCH_ARM | 3676 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |