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

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

Issue 334006: Simple toplevel code generator support for short-circuited boolean OR... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 1 month 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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 } 690 }
691 691
692 692
693 void CodeGenerator::UnloadReference(Reference* ref) { 693 void CodeGenerator::UnloadReference(Reference* ref) {
694 // Pop a reference from the stack while preserving TOS. 694 // Pop a reference from the stack while preserving TOS.
695 Comment cmnt(masm_, "[ UnloadReference"); 695 Comment cmnt(masm_, "[ UnloadReference");
696 frame_->Nip(ref->size()); 696 frame_->Nip(ref->size());
697 } 697 }
698 698
699 699
700 class ToBooleanStub: public CodeStub {
701 public:
702 ToBooleanStub() { }
703
704 void Generate(MacroAssembler* masm);
705
706 private:
707 Major MajorKey() { return ToBoolean; }
708 int MinorKey() { return 0; }
709 };
710
711
712 // ECMA-262, section 9.2, page 30: ToBoolean(). Pop the top of stack and 700 // ECMA-262, section 9.2, page 30: ToBoolean(). Pop the top of stack and
713 // convert it to a boolean in the condition code register or jump to 701 // convert it to a boolean in the condition code register or jump to
714 // 'false_target'/'true_target' as appropriate. 702 // 'false_target'/'true_target' as appropriate.
715 void CodeGenerator::ToBoolean(ControlDestination* dest) { 703 void CodeGenerator::ToBoolean(ControlDestination* dest) {
716 Comment cmnt(masm_, "[ ToBoolean"); 704 Comment cmnt(masm_, "[ ToBoolean");
717 705
718 // The value to convert should be popped from the frame. 706 // The value to convert should be popped from the frame.
719 Result value = frame_->Pop(); 707 Result value = frame_->Pop();
720 value.ToRegister(); 708 value.ToRegister();
721 // Fast case checks. 709 // Fast case checks.
(...skipping 7358 matching lines...) Expand 10 before | Expand all | Expand 10 after
8080 8068
8081 int CompareStub::MinorKey() { 8069 int CompareStub::MinorKey() {
8082 // Encode the two parameters in a unique 16 bit value. 8070 // Encode the two parameters in a unique 16 bit value.
8083 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); 8071 ASSERT(static_cast<unsigned>(cc_) < (1 << 15));
8084 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); 8072 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0);
8085 } 8073 }
8086 8074
8087 #undef __ 8075 #undef __
8088 8076
8089 } } // namespace v8::internal 8077 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698