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

Side by Side Diff: src/assembler.h

Issue 8352040: Speed up comparison with a constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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/arm/lithium-codegen-arm.cc ('k') | src/assembler.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 static inline bool is_uint28(int x) { return is_uintn(x, 28); } 840 static inline bool is_uint28(int x) { return is_uintn(x, 28); }
841 841
842 static inline int NumberOfBitsSet(uint32_t x) { 842 static inline int NumberOfBitsSet(uint32_t x) {
843 unsigned int num_bits_set; 843 unsigned int num_bits_set;
844 for (num_bits_set = 0; x; x >>= 1) { 844 for (num_bits_set = 0; x; x >>= 1) {
845 num_bits_set += x & 1; 845 num_bits_set += x & 1;
846 } 846 }
847 return num_bits_set; 847 return num_bits_set;
848 } 848 }
849 849
850 bool EvalComparison(Token::Value op, double op1, double op2);
851
850 // Computes pow(x, y) with the special cases in the spec for Math.pow. 852 // Computes pow(x, y) with the special cases in the spec for Math.pow.
851 double power_double_int(double x, int y); 853 double power_double_int(double x, int y);
852 double power_double_double(double x, double y); 854 double power_double_double(double x, double y);
853 855
854 // Helper class for generating code or data associated with the code 856 // Helper class for generating code or data associated with the code
855 // right after a call instruction. As an example this can be used to 857 // right after a call instruction. As an example this can be used to
856 // generate safepoint data after calls for crankshaft. 858 // generate safepoint data after calls for crankshaft.
857 class CallWrapper { 859 class CallWrapper {
858 public: 860 public:
859 CallWrapper() { } 861 CallWrapper() { }
860 virtual ~CallWrapper() { } 862 virtual ~CallWrapper() { }
861 // Called just before emitting a call. Argument is the size of the generated 863 // Called just before emitting a call. Argument is the size of the generated
862 // call code. 864 // call code.
863 virtual void BeforeCall(int call_size) const = 0; 865 virtual void BeforeCall(int call_size) const = 0;
864 // Called just after emitting a call, i.e., at the return site for the call. 866 // Called just after emitting a call, i.e., at the return site for the call.
865 virtual void AfterCall() const = 0; 867 virtual void AfterCall() const = 0;
866 }; 868 };
867 869
868 class NullCallWrapper : public CallWrapper { 870 class NullCallWrapper : public CallWrapper {
869 public: 871 public:
870 NullCallWrapper() { } 872 NullCallWrapper() { }
871 virtual ~NullCallWrapper() { } 873 virtual ~NullCallWrapper() { }
872 virtual void BeforeCall(int call_size) const { } 874 virtual void BeforeCall(int call_size) const { }
873 virtual void AfterCall() const { } 875 virtual void AfterCall() const { }
874 }; 876 };
875 877
876 } } // namespace v8::internal 878 } } // namespace v8::internal
877 879
878 #endif // V8_ASSEMBLER_H_ 880 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698