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

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

Issue 21538: Add constant folding and optimization for constant smi operands to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 11 years, 10 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 | « no previous file | src/codegen-ia32.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 void LoadTypeofExpression(Expression* x); 471 void LoadTypeofExpression(Expression* x);
472 472
473 // Translate the value on top of the frame into control flow to the 473 // Translate the value on top of the frame into control flow to the
474 // control destination. 474 // control destination.
475 void ToBoolean(ControlDestination* destination); 475 void ToBoolean(ControlDestination* destination);
476 476
477 void GenericBinaryOperation(Token::Value op, 477 void GenericBinaryOperation(Token::Value op,
478 StaticType* type, 478 StaticType* type,
479 const OverwriteMode overwrite_mode = NO_OVERWRITE); 479 const OverwriteMode overwrite_mode = NO_OVERWRITE);
480 480
481 // If possible, combine two constant smi values using op to produce
482 // a smi result, and push it on the virtual frame, all at compile time.
483 // Returns true if it succeeds. Otherwise it has no effect.
484 bool FoldConstantSmis(Token::Value op, int left, int right);
485
486 // Emit code to perform a binary operation on
487 // a constant smi and a likely smi. Consumes the argument "operand".
488 void ConstantSmiBinaryOperation(Token::Value op,
489 Result* operand,
490 Handle<Object> constant_operand,
491 StaticType* type,
492 bool reversed,
493 OverwriteMode overwrite_mode);
494
495 // Emit code to perform a binary operation on
496 // two likely smis. The code to handle smi arguments is produced inline.
497 // Consumes the arguments left and right.
498 void LikelySmiBinaryOperation(Token::Value op,
499 Result* left,
500 Result* right,
501 OverwriteMode overwrite_mode);
502
481 void Comparison(Condition cc, 503 void Comparison(Condition cc,
482 bool strict, 504 bool strict,
483 ControlDestination* destination); 505 ControlDestination* destination);
484 506
485 // To prevent long attacker-controlled byte sequences, integer constants 507 // To prevent long attacker-controlled byte sequences, integer constants
486 // from the JavaScript source are loaded in two parts if they are larger 508 // from the JavaScript source are loaded in two parts if they are larger
487 // than 16 bits. 509 // than 16 bits.
488 static const int kMaxSmiInlinedBits = 16; 510 static const int kMaxSmiInlinedBits = 16;
489 bool IsUnsafeSmi(Handle<Object> value); 511 bool IsUnsafeSmi(Handle<Object> value);
490 // Load an integer constant x into a register target using 512 // Load an integer constant x into a register target using
491 // at most 16 bits of user-controlled data per assembly operation. 513 // at most 16 bits of user-controlled data per assembly operation.
492 void LoadUnsafeSmi(Register target, Handle<Object> value); 514 void LoadUnsafeSmi(Register target, Handle<Object> value);
493 515
494 bool IsInlineSmi(Literal* literal);
495 void SmiOperation(Token::Value op,
496 StaticType* type,
497 Handle<Object> value,
498 bool reversed,
499 OverwriteMode overwrite_mode);
500
501 void CallWithArguments(ZoneList<Expression*>* arguments, int position); 516 void CallWithArguments(ZoneList<Expression*>* arguments, int position);
502 517
503 void CheckStack(); 518 void CheckStack();
504 void CleanStack(int num_bytes); 519 void CleanStack(int num_bytes);
505 520
506 bool CheckForInlineRuntimeCall(CallRuntime* node); 521 bool CheckForInlineRuntimeCall(CallRuntime* node);
507 Handle<JSFunction> BuildBoilerplate(FunctionLiteral* node); 522 Handle<JSFunction> BuildBoilerplate(FunctionLiteral* node);
508 void ProcessDeclarations(ZoneList<Declaration*>* declarations); 523 void ProcessDeclarations(ZoneList<Declaration*>* declarations);
509 524
510 Handle<Code> ComputeCallInitialize(int argc); 525 Handle<Code> ComputeCallInitialize(int argc);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 cgen_->set_in_spilled_code(false); 664 cgen_->set_in_spilled_code(false);
650 GetValue(typeof_state); 665 GetValue(typeof_state);
651 cgen_->frame()->SpillAll(); 666 cgen_->frame()->SpillAll();
652 cgen_->set_in_spilled_code(true); 667 cgen_->set_in_spilled_code(true);
653 } 668 }
654 669
655 670
656 } } // namespace v8::internal 671 } } // namespace v8::internal
657 672
658 #endif // V8_CODEGEN_IA32_H_ 673 #endif // V8_CODEGEN_IA32_H_
OLDNEW
« no previous file with comments | « no previous file | src/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698