Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 9150026: MIPS: Allow call-known-global and call-constant-function to be used (Closed)
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 } 740 }
741 741
742 // Invoke function. 742 // Invoke function.
743 if (can_do_fast_api_call) { 743 if (can_do_fast_api_call) {
744 GenerateFastApiDirectCall(masm, optimization, arguments_.immediate()); 744 GenerateFastApiDirectCall(masm, optimization, arguments_.immediate());
745 } else { 745 } else {
746 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_) 746 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
747 ? CALL_AS_FUNCTION 747 ? CALL_AS_FUNCTION
748 : CALL_AS_METHOD; 748 : CALL_AS_METHOD;
749 __ InvokeFunction(optimization.constant_function(), arguments_, 749 __ InvokeFunction(optimization.constant_function(), arguments_,
750 JUMP_FUNCTION, call_kind); 750 JUMP_FUNCTION, NullCallWrapper(), call_kind);
751 } 751 }
752 752
753 // Deferred code for fast API call case---clean preallocated space. 753 // Deferred code for fast API call case---clean preallocated space.
754 if (can_do_fast_api_call) { 754 if (can_do_fast_api_call) {
755 __ bind(&miss_cleanup); 755 __ bind(&miss_cleanup);
756 FreeSpaceForFastApiCall(masm); 756 FreeSpaceForFastApiCall(masm);
757 __ Branch(miss_label); 757 __ Branch(miss_label);
758 } 758 }
759 759
760 // Invoke a regular function. 760 // Invoke a regular function.
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 generator.GenerateFast(masm()); 1927 generator.GenerateFast(masm());
1928 __ Drop(argc + 1); 1928 __ Drop(argc + 1);
1929 __ Ret(); 1929 __ Ret();
1930 1930
1931 StubRuntimeCallHelper call_helper; 1931 StubRuntimeCallHelper call_helper;
1932 generator.GenerateSlow(masm(), call_helper); 1932 generator.GenerateSlow(masm(), call_helper);
1933 1933
1934 // Tail call the full function. We do not have to patch the receiver 1934 // Tail call the full function. We do not have to patch the receiver
1935 // because the function makes no use of it. 1935 // because the function makes no use of it.
1936 __ bind(&slow); 1936 __ bind(&slow);
1937 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, CALL_AS_METHOD); 1937 __ InvokeFunction(
1938 function, arguments(), JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
1938 1939
1939 __ bind(&miss); 1940 __ bind(&miss);
1940 // a2: function name. 1941 // a2: function name.
1941 GenerateMissBranch(); 1942 GenerateMissBranch();
1942 1943
1943 // Return the generated code. 1944 // Return the generated code.
1944 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name); 1945 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name);
1945 } 1946 }
1946 1947
1947 1948
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 __ Drop(argc + 1); 2061 __ Drop(argc + 1);
2061 __ Ret(); 2062 __ Ret();
2062 2063
2063 __ bind(&wont_fit_smi); 2064 __ bind(&wont_fit_smi);
2064 // Restore FCSR and fall to slow case. 2065 // Restore FCSR and fall to slow case.
2065 __ ctc1(a3, FCSR); 2066 __ ctc1(a3, FCSR);
2066 2067
2067 __ bind(&slow); 2068 __ bind(&slow);
2068 // Tail call the full function. We do not have to patch the receiver 2069 // Tail call the full function. We do not have to patch the receiver
2069 // because the function makes no use of it. 2070 // because the function makes no use of it.
2070 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, CALL_AS_METHOD); 2071 __ InvokeFunction(
2072 function, arguments(), JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
2071 2073
2072 __ bind(&miss); 2074 __ bind(&miss);
2073 // a2: function name. 2075 // a2: function name.
2074 GenerateMissBranch(); 2076 GenerateMissBranch();
2075 2077
2076 // Return the generated code. 2078 // Return the generated code.
2077 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name); 2079 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name);
2078 } 2080 }
2079 2081
2080 2082
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 __ LoadRoot(t2, Heap::kHeapNumberMapRootIndex); 2162 __ LoadRoot(t2, Heap::kHeapNumberMapRootIndex);
2161 __ AllocateHeapNumber(v0, t0, t1, t2, &slow); 2163 __ AllocateHeapNumber(v0, t0, t1, t2, &slow);
2162 __ sw(a1, FieldMemOperand(v0, HeapNumber::kExponentOffset)); 2164 __ sw(a1, FieldMemOperand(v0, HeapNumber::kExponentOffset));
2163 __ sw(a3, FieldMemOperand(v0, HeapNumber::kMantissaOffset)); 2165 __ sw(a3, FieldMemOperand(v0, HeapNumber::kMantissaOffset));
2164 __ Drop(argc + 1); 2166 __ Drop(argc + 1);
2165 __ Ret(); 2167 __ Ret();
2166 2168
2167 // Tail call the full function. We do not have to patch the receiver 2169 // Tail call the full function. We do not have to patch the receiver
2168 // because the function makes no use of it. 2170 // because the function makes no use of it.
2169 __ bind(&slow); 2171 __ bind(&slow);
2170 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, CALL_AS_METHOD); 2172 __ InvokeFunction(
2173 function, arguments(), JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
2171 2174
2172 __ bind(&miss); 2175 __ bind(&miss);
2173 // a2: function name. 2176 // a2: function name.
2174 GenerateMissBranch(); 2177 GenerateMissBranch();
2175 2178
2176 // Return the generated code. 2179 // Return the generated code.
2177 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name); 2180 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name);
2178 } 2181 }
2179 2182
2180 2183
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2339 // Calling non-strict non-builtins with a value as the receiver 2342 // Calling non-strict non-builtins with a value as the receiver
2340 // requires boxing. 2343 // requires boxing.
2341 __ jmp(&miss); 2344 __ jmp(&miss);
2342 } 2345 }
2343 break; 2346 break;
2344 } 2347 }
2345 2348
2346 CallKind call_kind = CallICBase::Contextual::decode(extra_state_) 2349 CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
2347 ? CALL_AS_FUNCTION 2350 ? CALL_AS_FUNCTION
2348 : CALL_AS_METHOD; 2351 : CALL_AS_METHOD;
2349 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, call_kind); 2352 __ InvokeFunction(
2353 function, arguments(), JUMP_FUNCTION, NullCallWrapper(), call_kind);
2350 2354
2351 // Handle call cache miss. 2355 // Handle call cache miss.
2352 __ bind(&miss); 2356 __ bind(&miss);
2353 2357
2354 GenerateMissBranch(); 2358 GenerateMissBranch();
2355 2359
2356 // Return the generated code. 2360 // Return the generated code.
2357 return GetCode(function); 2361 return GetCode(function);
2358 } 2362 }
2359 2363
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
4305 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4309 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4306 __ Jump(ic_miss, RelocInfo::CODE_TARGET); 4310 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4307 } 4311 }
4308 4312
4309 4313
4310 #undef __ 4314 #undef __
4311 4315
4312 } } // namespace v8::internal 4316 } } // namespace v8::internal
4313 4317
4314 #endif // V8_TARGET_ARCH_MIPS 4318 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698