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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 10382033: x86/x64 port of Math.floor(x/y) to use integer division for specific divisor (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 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
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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 } 933 }
934 934
935 935
936 HValue* HUnaryMathOperation::Canonicalize() { 936 HValue* HUnaryMathOperation::Canonicalize() {
937 if (op() == kMathFloor) { 937 if (op() == kMathFloor) {
938 // If the input is integer32 then we replace the floor instruction 938 // If the input is integer32 then we replace the floor instruction
939 // with its input. This happens before the representation changes are 939 // with its input. This happens before the representation changes are
940 // introduced. 940 // introduced.
941 if (value()->representation().IsInteger32()) return value(); 941 if (value()->representation().IsInteger32()) return value();
942 942
943 #ifdef V8_TARGET_ARCH_ARM 943 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_IA32) || \
944 defined(V8_TARGET_ARCH_X64)
944 if (value()->IsDiv() && (value()->UseCount() == 1)) { 945 if (value()->IsDiv() && (value()->UseCount() == 1)) {
945 // TODO(2038): Implement this optimization for non ARM architectures. 946 // TODO(2038): Implement this optimization for non ARM architectures.
946 HDiv* hdiv = HDiv::cast(value()); 947 HDiv* hdiv = HDiv::cast(value());
947 HValue* left = hdiv->left(); 948 HValue* left = hdiv->left();
948 HValue* right = hdiv->right(); 949 HValue* right = hdiv->right();
949 // Try to simplify left and right values of the division. 950 // Try to simplify left and right values of the division.
950 HValue* new_left = 951 HValue* new_left =
951 LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(left); 952 LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(left);
952 HValue* new_right = 953 HValue* new_right =
953 LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(right); 954 LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(right);
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
2436 2437
2437 2438
2438 void HCheckPrototypeMaps::Verify() { 2439 void HCheckPrototypeMaps::Verify() {
2439 HInstruction::Verify(); 2440 HInstruction::Verify();
2440 ASSERT(HasNoUses()); 2441 ASSERT(HasNoUses());
2441 } 2442 }
2442 2443
2443 #endif 2444 #endif
2444 2445
2445 } } // namespace v8::internal 2446 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698