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

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 10829169: Refactor Math.min/max to be a single HInstruction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback; removed VORR instruction Created 8 years, 4 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/ia32/lithium-ia32.h ('k') | src/x64/lithium-codegen-x64.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 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 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 return result; 1388 return result;
1389 } else if (instr->representation().IsDouble()) { 1389 } else if (instr->representation().IsDouble()) {
1390 return DoArithmeticD(Token::ADD, instr); 1390 return DoArithmeticD(Token::ADD, instr);
1391 } else { 1391 } else {
1392 ASSERT(instr->representation().IsTagged()); 1392 ASSERT(instr->representation().IsTagged());
1393 return DoArithmeticT(Token::ADD, instr); 1393 return DoArithmeticT(Token::ADD, instr);
1394 } 1394 }
1395 } 1395 }
1396 1396
1397 1397
1398 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) {
1399 LOperand* left = NULL;
1400 LOperand* right = NULL;
1401 if (instr->representation().IsInteger32()) {
1402 ASSERT(instr->left()->representation().IsInteger32());
1403 ASSERT(instr->right()->representation().IsInteger32());
1404 left = UseRegisterAtStart(instr->LeastConstantOperand());
1405 right = UseOrConstantAtStart(instr->MostConstantOperand());
1406 } else {
1407 ASSERT(instr->representation().IsDouble());
1408 ASSERT(instr->left()->representation().IsDouble());
1409 ASSERT(instr->right()->representation().IsDouble());
1410 left = UseRegisterAtStart(instr->left());
1411 right = UseRegisterAtStart(instr->right());
1412 }
1413 LMathMinMax* minmax = new(zone()) LMathMinMax(left, right);
1414 return DefineSameAsFirst(minmax);
1415 }
1416
1417
1398 LInstruction* LChunkBuilder::DoPower(HPower* instr) { 1418 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1399 ASSERT(instr->representation().IsDouble()); 1419 ASSERT(instr->representation().IsDouble());
1400 // We call a C function for double power. It can't trigger a GC. 1420 // We call a C function for double power. It can't trigger a GC.
1401 // We need to use fixed result register for the call. 1421 // We need to use fixed result register for the call.
1402 Representation exponent_type = instr->right()->representation(); 1422 Representation exponent_type = instr->right()->representation();
1403 ASSERT(instr->left()->representation().IsDouble()); 1423 ASSERT(instr->left()->representation().IsDouble());
1404 LOperand* left = UseFixedDouble(instr->left(), xmm2); 1424 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1405 LOperand* right = exponent_type.IsDouble() ? 1425 LOperand* right = exponent_type.IsDouble() ?
1406 UseFixedDouble(instr->right(), xmm1) : 1426 UseFixedDouble(instr->right(), xmm1) :
1407 UseFixed(instr->right(), eax); 1427 UseFixed(instr->right(), eax);
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2416 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2397 LOperand* object = UseRegister(instr->object()); 2417 LOperand* object = UseRegister(instr->object());
2398 LOperand* index = UseTempRegister(instr->index()); 2418 LOperand* index = UseTempRegister(instr->index());
2399 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2419 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2400 } 2420 }
2401 2421
2402 2422
2403 } } // namespace v8::internal 2423 } } // namespace v8::internal
2404 2424
2405 #endif // V8_TARGET_ARCH_IA32 2425 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698