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

Side by Side Diff: src/x64/codegen-x64.h

Issue 2897013: Avoid a smi check when comparing an unknown to a constant smi for equality on... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 5 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/codegen-ia32.cc ('k') | src/x64/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 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // Consumes the Results *left and *right. 514 // Consumes the Results *left and *right.
515 Result LikelySmiBinaryOperation(BinaryOperation* expr, 515 Result LikelySmiBinaryOperation(BinaryOperation* expr,
516 Result* left, 516 Result* left,
517 Result* right, 517 Result* right,
518 OverwriteMode overwrite_mode); 518 OverwriteMode overwrite_mode);
519 519
520 void Comparison(AstNode* node, 520 void Comparison(AstNode* node,
521 Condition cc, 521 Condition cc,
522 bool strict, 522 bool strict,
523 ControlDestination* destination); 523 ControlDestination* destination);
524
525 // If at least one of the sides is a constant smi, generate optimized code.
526 void ConstantSmiComparison(Condition cc,
527 bool strict,
528 ControlDestination* destination,
529 Result* left_side,
530 Result* right_side,
531 bool left_side_constant_smi,
532 bool right_side_constant_smi,
533 bool is_loop_condition);
534
524 void GenerateInlineNumberComparison(Result* left_side, 535 void GenerateInlineNumberComparison(Result* left_side,
525 Result* right_side, 536 Result* right_side,
526 Condition cc, 537 Condition cc,
527 ControlDestination* dest); 538 ControlDestination* dest);
528 539
529 // To prevent long attacker-controlled byte sequences, integer constants 540 // To prevent long attacker-controlled byte sequences, integer constants
530 // from the JavaScript source are loaded in two parts if they are larger 541 // from the JavaScript source are loaded in two parts if they are larger
531 // than 16 bits. 542 // than 16 bits.
532 static const int kMaxSmiInlinedBits = 16; 543 static const int kMaxSmiInlinedBits = 16;
533 bool IsUnsafeSmi(Handle<Object> value); 544 bool IsUnsafeSmi(Handle<Object> value);
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 return ObjectBits::encode(object_.code()) | 1061 return ObjectBits::encode(object_.code()) |
1051 AddressBits::encode(addr_.code()) | 1062 AddressBits::encode(addr_.code()) |
1052 ScratchBits::encode(scratch_.code()); 1063 ScratchBits::encode(scratch_.code());
1053 } 1064 }
1054 }; 1065 };
1055 1066
1056 1067
1057 } } // namespace v8::internal 1068 } } // namespace v8::internal
1058 1069
1059 #endif // V8_X64_CODEGEN_X64_H_ 1070 #endif // V8_X64_CODEGEN_X64_H_
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698