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

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

Issue 1108006: Fix GetName and Print for CompareStub (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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.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 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 7096 matching lines...) Expand 10 before | Expand all | Expand 10 after
7107 // of the original receiver from the call site). 7107 // of the original receiver from the call site).
7108 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); 7108 __ str(r1, MemOperand(sp, argc_ * kPointerSize));
7109 __ mov(r0, Operand(argc_)); // Setup the number of arguments. 7109 __ mov(r0, Operand(argc_)); // Setup the number of arguments.
7110 __ mov(r2, Operand(0)); 7110 __ mov(r2, Operand(0));
7111 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); 7111 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
7112 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), 7112 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)),
7113 RelocInfo::CODE_TARGET); 7113 RelocInfo::CODE_TARGET);
7114 } 7114 }
7115 7115
7116 7116
7117 // Unfortunately you have to run without snapshots to see most of these
7118 // names in the profile since most compare stubs end up in the snapshot.
7117 const char* CompareStub::GetName() { 7119 const char* CompareStub::GetName() {
7120 if (name_ != NULL) return name_;
7121 const int kMaxNameLength = 100;
7122 name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength);
7123 if (name_ == NULL) return "OOM";
7124
7125 const char* cc_name;
7118 switch (cc_) { 7126 switch (cc_) {
7119 case lt: return "CompareStub_LT"; 7127 case lt: cc_name = "LT"; break;
7120 case gt: return "CompareStub_GT"; 7128 case gt: cc_name = "GT"; break;
7121 case le: return "CompareStub_LE"; 7129 case le: cc_name = "LE"; break;
7122 case ge: return "CompareStub_GE"; 7130 case ge: cc_name = "GE"; break;
7123 case ne: { 7131 case eq: cc_name = "EQ"; break;
7124 if (strict_) { 7132 case ne: cc_name = "NE"; break;
7125 if (never_nan_nan_) { 7133 default: cc_name = "UnknownCondition"; break;
7126 return "CompareStub_NE_STRICT_NO_NAN";
7127 } else {
7128 return "CompareStub_NE_STRICT";
7129 }
7130 } else {
7131 if (never_nan_nan_) {
7132 return "CompareStub_NE_NO_NAN";
7133 } else {
7134 return "CompareStub_NE";
7135 }
7136 }
7137 }
7138 case eq: {
7139 if (strict_) {
7140 if (never_nan_nan_) {
7141 return "CompareStub_EQ_STRICT_NO_NAN";
7142 } else {
7143 return "CompareStub_EQ_STRICT";
7144 }
7145 } else {
7146 if (never_nan_nan_) {
7147 return "CompareStub_EQ_NO_NAN";
7148 } else {
7149 return "CompareStub_EQ";
7150 }
7151 }
7152 }
7153 default: return "CompareStub";
7154 } 7134 }
7135
7136 const char* strict_name = "";
7137 if (strict_ && (cc_ == eq || cc_ == ne)) {
7138 strict_name = "_STRICT";
7139 }
7140
7141 const char* never_nan_nan_name = "";
7142 if (never_nan_nan_ && (cc_ == eq || cc_ == ne)) {
7143 never_nan_nan_name = "_NO_NAN";
7144 }
7145
7146 const char* include_number_compare_name = "";
7147 if (!include_number_compare_) {
7148 include_number_compare_name = "_NO_NUMBER";
7149 }
7150
7151 OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
7152 "CompareStub_%s%s%s%s",
7153 cc_name,
7154 strict_name,
7155 never_nan_nan_name,
7156 include_number_compare_name);
7157 return name_;
7155 } 7158 }
7156 7159
7157 7160
7158 int CompareStub::MinorKey() { 7161 int CompareStub::MinorKey() {
7159 // Encode the three parameters in a unique 16 bit value. To avoid duplicate 7162 // Encode the three parameters in a unique 16 bit value. To avoid duplicate
7160 // stubs the never NaN NaN condition is only taken into account if the 7163 // stubs the never NaN NaN condition is only taken into account if the
7161 // condition is equals. 7164 // condition is equals.
7162 ASSERT((static_cast<unsigned>(cc_) >> 28) < (1 << 13)); 7165 ASSERT((static_cast<unsigned>(cc_) >> 28) < (1 << 13));
7163 return ConditionField::encode(static_cast<unsigned>(cc_) >> 28) 7166 return ConditionField::encode(static_cast<unsigned>(cc_) >> 28)
7164 | StrictField::encode(strict_) 7167 | StrictField::encode(strict_)
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
8042 8045
8043 // Just jump to runtime to add the two strings. 8046 // Just jump to runtime to add the two strings.
8044 __ bind(&string_add_runtime); 8047 __ bind(&string_add_runtime);
8045 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 8048 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
8046 } 8049 }
8047 8050
8048 8051
8049 #undef __ 8052 #undef __
8050 8053
8051 } } // namespace v8::internal 8054 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698