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

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

Issue 5781010: Addresses some performance regression in the GenericBinaryOpStub on ARM followin... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years 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/arm/code-stubs-arm.h ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 // After this point we have the left hand side in r1 and the right hand side 1222 // After this point we have the left hand side in r1 and the right hand side
1223 // in r0. 1223 // in r0.
1224 if (lhs.is(r0)) { 1224 if (lhs.is(r0)) {
1225 __ Swap(r0, r1, ip); 1225 __ Swap(r0, r1, ip);
1226 } 1226 }
1227 1227
1228 // The type transition also calculates the answer. 1228 // The type transition also calculates the answer.
1229 bool generate_code_to_calculate_answer = true; 1229 bool generate_code_to_calculate_answer = true;
1230 1230
1231 if (ShouldGenerateFPCode()) { 1231 if (ShouldGenerateFPCode()) {
1232 if (runtime_operands_type_ == BinaryOpIC::DEFAULT) { 1232 // DIV has neither SmiSmi fast code nor specialized slow code.
1233 // So don't try to patch a DIV Stub.
1234 if ((runtime_operands_type_ == BinaryOpIC::DEFAULT) &&
1235 (op_ != Token::DIV)) {
1233 switch (op_) { 1236 switch (op_) {
1234 case Token::ADD: 1237 case Token::ADD:
1235 case Token::SUB: 1238 case Token::SUB:
1236 case Token::MUL: 1239 case Token::MUL:
1237 case Token::DIV:
1238 GenerateTypeTransition(masm); // Tail call. 1240 GenerateTypeTransition(masm); // Tail call.
1239 generate_code_to_calculate_answer = false; 1241 generate_code_to_calculate_answer = false;
1240 break; 1242 break;
1241 1243
Søren Thygesen Gjesse 2010/12/17 10:28:38 Wouldn't it be more readable to have an empty case
1242 default: 1244 default:
1243 break; 1245 break;
1244 } 1246 }
1245 } 1247 }
1246 1248
1247 if (generate_code_to_calculate_answer) { 1249 if (generate_code_to_calculate_answer) {
1248 Label r0_is_smi, r1_is_smi, finished_loading_r0, finished_loading_r1; 1250 Label r0_is_smi, r1_is_smi, finished_loading_r0, finished_loading_r1;
1249 if (mode_ == NO_OVERWRITE) { 1251 if (mode_ == NO_OVERWRITE) {
1250 // In the case where there is no chance of an overwritable float we may 1252 // In the case where there is no chance of an overwritable float we may
1251 // as well do the allocation immediately while r0 and r1 are untouched. 1253 // as well do the allocation immediately while r0 and r1 are untouched.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 __ mov(r7, Operand(r0)); 1294 __ mov(r7, Operand(r0));
1293 ConvertToDoubleStub stub3(r3, r2, r7, r4); 1295 ConvertToDoubleStub stub3(r3, r2, r7, r4);
1294 __ push(lr); 1296 __ push(lr);
1295 __ Call(stub3.GetCode(), RelocInfo::CODE_TARGET); 1297 __ Call(stub3.GetCode(), RelocInfo::CODE_TARGET);
1296 __ pop(lr); 1298 __ pop(lr);
1297 } 1299 }
1298 1300
1299 // HEAP_NUMBERS stub is slower than GENERIC on a pair of smis. 1301 // HEAP_NUMBERS stub is slower than GENERIC on a pair of smis.
1300 // r0 is known to be a smi. If r1 is also a smi then switch to GENERIC. 1302 // r0 is known to be a smi. If r1 is also a smi then switch to GENERIC.
1301 Label r1_is_not_smi; 1303 Label r1_is_not_smi;
1302 if (runtime_operands_type_ == BinaryOpIC::HEAP_NUMBERS) { 1304 if ((runtime_operands_type_ == BinaryOpIC::HEAP_NUMBERS) &&
1305 HasSmiSmiFastPath()) {
1303 __ tst(r1, Operand(kSmiTagMask)); 1306 __ tst(r1, Operand(kSmiTagMask));
1304 __ b(ne, &r1_is_not_smi); 1307 __ b(ne, &r1_is_not_smi);
1305 GenerateTypeTransition(masm); // Tail call. 1308 GenerateTypeTransition(masm); // Tail call.
1306 } 1309 }
1307 1310
1308 __ bind(&finished_loading_r0); 1311 __ bind(&finished_loading_r0);
1309 1312
1310 // Move r1 to a double in r0-r1. 1313 // Move r1 to a double in r0-r1.
1311 __ tst(r1, Operand(kSmiTagMask)); 1314 __ tst(r1, Operand(kSmiTagMask));
1312 __ b(eq, &r1_is_smi); // It's a Smi so don't check it's a heap number. 1315 __ b(eq, &r1_is_smi); // It's a Smi so don't check it's a heap number.
(...skipping 3646 matching lines...) Expand 10 before | Expand all | Expand 10 after
4959 __ pop(r1); 4962 __ pop(r1);
4960 __ Jump(r2); 4963 __ Jump(r2);
4961 } 4964 }
4962 4965
4963 4966
4964 #undef __ 4967 #undef __
4965 4968
4966 } } // namespace v8::internal 4969 } } // namespace v8::internal
4967 4970
4968 #endif // V8_TARGET_ARCH_ARM 4971 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698