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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 15735005: Collect type feedback for power-of-2 right operands in BinaryOps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/type-info.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 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 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 (ERECT_FRAME | NO_STRING_CHECK_RIGHT_IN_STUB)); 1181 (ERECT_FRAME | NO_STRING_CHECK_RIGHT_IN_STUB));
1182 BinaryOpStub_GenerateRegisterArgsPushUnderReturn(masm); 1182 BinaryOpStub_GenerateRegisterArgsPushUnderReturn(masm);
1183 __ TailCallStub(&string_add_right_stub); 1183 __ TailCallStub(&string_add_right_stub);
1184 1184
1185 // Neither argument is a string. 1185 // Neither argument is a string.
1186 __ bind(&call_runtime); 1186 __ bind(&call_runtime);
1187 } 1187 }
1188 1188
1189 1189
1190 void BinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { 1190 void BinaryOpStub::GenerateSmiStub(MacroAssembler* masm) {
1191 Label call_runtime; 1191 Label right_arg_changed, call_runtime;
1192
1193 if (op_ == Token::MOD && has_fixed_right_arg_) {
1194 // It is guaranteed that the value will fit into a Smi, because if it
1195 // didn't, we wouldn't be here, see BinaryOp_Patch.
1196 __ Cmp(rax, Smi::FromInt(fixed_right_arg_value()));
1197 __ j(not_equal, &right_arg_changed);
1198 }
1199
1192 if (result_type_ == BinaryOpIC::UNINITIALIZED || 1200 if (result_type_ == BinaryOpIC::UNINITIALIZED ||
1193 result_type_ == BinaryOpIC::SMI) { 1201 result_type_ == BinaryOpIC::SMI) {
1194 // Only allow smi results. 1202 // Only allow smi results.
1195 BinaryOpStub_GenerateSmiCode(masm, NULL, NO_HEAPNUMBER_RESULTS, op_); 1203 BinaryOpStub_GenerateSmiCode(masm, NULL, NO_HEAPNUMBER_RESULTS, op_);
1196 } else { 1204 } else {
1197 // Allow heap number result and don't make a transition if a heap number 1205 // Allow heap number result and don't make a transition if a heap number
1198 // cannot be allocated. 1206 // cannot be allocated.
1199 BinaryOpStub_GenerateSmiCode( 1207 BinaryOpStub_GenerateSmiCode(
1200 masm, &call_runtime, ALLOW_HEAPNUMBER_RESULTS, op_); 1208 masm, &call_runtime, ALLOW_HEAPNUMBER_RESULTS, op_);
1201 } 1209 }
1202 1210
1203 // Code falls through if the result is not returned as either a smi or heap 1211 // Code falls through if the result is not returned as either a smi or heap
1204 // number. 1212 // number.
1213 __ bind(&right_arg_changed);
1205 GenerateTypeTransition(masm); 1214 GenerateTypeTransition(masm);
1206 1215
1207 if (call_runtime.is_linked()) { 1216 if (call_runtime.is_linked()) {
1208 __ bind(&call_runtime); 1217 __ bind(&call_runtime);
1209 { 1218 {
1210 FrameScope scope(masm, StackFrame::INTERNAL); 1219 FrameScope scope(masm, StackFrame::INTERNAL);
1211 GenerateRegisterArgsPush(masm); 1220 GenerateRegisterArgsPush(masm);
1212 GenerateCallRuntime(masm); 1221 GenerateCallRuntime(masm);
1213 } 1222 }
1214 __ Ret(); 1223 __ Ret();
(...skipping 5705 matching lines...) Expand 10 before | Expand all | Expand 10 after
6920 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); 6929 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
6921 } 6930 }
6922 } 6931 }
6923 6932
6924 6933
6925 #undef __ 6934 #undef __
6926 6935
6927 } } // namespace v8::internal 6936 } } // namespace v8::internal
6928 6937
6929 #endif // V8_TARGET_ARCH_X64 6938 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/type-info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698