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

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

Issue 488017: Give the binary op stubs better names to make profiles more informative. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years 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.h ('k') | src/token.h » ('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-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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 Register scratch); 756 Register scratch);
757 // Test if operands are numbers (smi or HeapNumber objects), and load 757 // Test if operands are numbers (smi or HeapNumber objects), and load
758 // them into xmm0 and xmm1 if they are. Jump to label not_numbers if 758 // them into xmm0 and xmm1 if they are. Jump to label not_numbers if
759 // either operand is not a number. Operands are in edx and eax. 759 // either operand is not a number. Operands are in edx and eax.
760 // Leaves operands unchanged. 760 // Leaves operands unchanged.
761 static void LoadSse2Operands(MacroAssembler* masm, Label* not_numbers); 761 static void LoadSse2Operands(MacroAssembler* masm, Label* not_numbers);
762 }; 762 };
763 763
764 764
765 const char* GenericBinaryOpStub::GetName() { 765 const char* GenericBinaryOpStub::GetName() {
766 switch (op_) { 766 if (name_ != NULL) return name_;
767 case Token::ADD: return "GenericBinaryOpStub_ADD"; 767 const int len = 100;
768 case Token::SUB: return "GenericBinaryOpStub_SUB"; 768 name_ = Bootstrapper::AllocateAutoDeletedArray(len);
769 case Token::MUL: return "GenericBinaryOpStub_MUL"; 769 if (name_ == NULL) return "OOM";
770 case Token::DIV: return "GenericBinaryOpStub_DIV"; 770 const char* op_name = Token::Name(op_);
771 case Token::BIT_OR: return "GenericBinaryOpStub_BIT_OR"; 771 const char* overwrite_name;
772 case Token::BIT_AND: return "GenericBinaryOpStub_BIT_AND"; 772 switch (mode_) {
773 case Token::BIT_XOR: return "GenericBinaryOpStub_BIT_XOR"; 773 case NO_OVERWRITE: overwrite_name = "Alloc"; break;
774 case Token::SAR: return "GenericBinaryOpStub_SAR"; 774 case OVERWRITE_RIGHT: overwrite_name = "OverwriteRight"; break;
775 case Token::SHL: return "GenericBinaryOpStub_SHL"; 775 case OVERWRITE_LEFT: overwrite_name = "OverwriteLeft"; break;
776 case Token::SHR: return "GenericBinaryOpStub_SHR"; 776 default: overwrite_name = "UnknownOverwrite"; break;
777 default: return "GenericBinaryOpStub";
778 } 777 }
778
779 OS::SNPrintF(Vector<char>(name_, len),
780 "GenericBinaryOpStub_%s_%s%s_%s%s",
781 op_name,
782 overwrite_name,
783 (flags_ & NO_SMI_CODE_IN_STUB) ? "_NoSmiInStub" : "",
784 args_in_registers_ ? "RegArgs" : "StackArgs",
785 args_reversed_ ? "_R" : "");
786 return name_;
779 } 787 }
780 788
781 789
782 // Call the specialized stub for a binary operation. 790 // Call the specialized stub for a binary operation.
783 class DeferredInlineBinaryOperation: public DeferredCode { 791 class DeferredInlineBinaryOperation: public DeferredCode {
784 public: 792 public:
785 DeferredInlineBinaryOperation(Token::Value op, 793 DeferredInlineBinaryOperation(Token::Value op,
786 Register dst, 794 Register dst,
787 Register left, 795 Register left,
788 Register right, 796 Register right,
(...skipping 7661 matching lines...) Expand 10 before | Expand all | Expand 10 after
8450 __ add(Operand(dest), Immediate(2)); 8458 __ add(Operand(dest), Immediate(2));
8451 } 8459 }
8452 __ sub(Operand(count), Immediate(1)); 8460 __ sub(Operand(count), Immediate(1));
8453 __ j(not_zero, &loop); 8461 __ j(not_zero, &loop);
8454 } 8462 }
8455 8463
8456 8464
8457 #undef __ 8465 #undef __
8458 8466
8459 } } // namespace v8::internal 8467 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.h ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698