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

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

Issue 1251009: Re-apply "Inline floating point compare"... (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') | test/mjsunit/regress/regress-crbug-39160.js » ('J')
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 7000 matching lines...) Expand 10 before | Expand all | Expand 10 after
7011 // of the original receiver from the call site). 7011 // of the original receiver from the call site).
7012 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); 7012 __ str(r1, MemOperand(sp, argc_ * kPointerSize));
7013 __ mov(r0, Operand(argc_)); // Setup the number of arguments. 7013 __ mov(r0, Operand(argc_)); // Setup the number of arguments.
7014 __ mov(r2, Operand(0)); 7014 __ mov(r2, Operand(0));
7015 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); 7015 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
7016 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), 7016 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)),
7017 RelocInfo::CODE_TARGET); 7017 RelocInfo::CODE_TARGET);
7018 } 7018 }
7019 7019
7020 7020
7021 // Unfortunately you have to run without snapshots to see most of these
7022 // names in the profile since most compare stubs end up in the snapshot.
7021 const char* CompareStub::GetName() { 7023 const char* CompareStub::GetName() {
7024 if (name_ != NULL) return name_;
7025 const int kMaxNameLength = 100;
7026 name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength);
7027 if (name_ == NULL) return "OOM";
7028
7029 const char* cc_name;
7022 switch (cc_) { 7030 switch (cc_) {
7023 case lt: return "CompareStub_LT"; 7031 case lt: cc_name = "LT"; break;
7024 case gt: return "CompareStub_GT"; 7032 case gt: cc_name = "GT"; break;
7025 case le: return "CompareStub_LE"; 7033 case le: cc_name = "LE"; break;
7026 case ge: return "CompareStub_GE"; 7034 case ge: cc_name = "GE"; break;
7027 case ne: { 7035 case eq: cc_name = "EQ"; break;
7028 if (strict_) { 7036 case ne: cc_name = "NE"; break;
7029 if (never_nan_nan_) { 7037 default: cc_name = "UnknownCondition"; break;
7030 return "CompareStub_NE_STRICT_NO_NAN";
7031 } else {
7032 return "CompareStub_NE_STRICT";
7033 }
7034 } else {
7035 if (never_nan_nan_) {
7036 return "CompareStub_NE_NO_NAN";
7037 } else {
7038 return "CompareStub_NE";
7039 }
7040 }
7041 }
7042 case eq: {
7043 if (strict_) {
7044 if (never_nan_nan_) {
7045 return "CompareStub_EQ_STRICT_NO_NAN";
7046 } else {
7047 return "CompareStub_EQ_STRICT";
7048 }
7049 } else {
7050 if (never_nan_nan_) {
7051 return "CompareStub_EQ_NO_NAN";
7052 } else {
7053 return "CompareStub_EQ";
7054 }
7055 }
7056 }
7057 default: return "CompareStub";
7058 } 7038 }
7039
7040 const char* strict_name = "";
7041 if (strict_ && (cc_ == eq || cc_ == ne)) {
7042 strict_name = "_STRICT";
7043 }
7044
7045 const char* never_nan_nan_name = "";
7046 if (never_nan_nan_ && (cc_ == eq || cc_ == ne)) {
7047 never_nan_nan_name = "_NO_NAN";
7048 }
7049
7050 const char* include_number_compare_name = "";
7051 if (!include_number_compare_) {
7052 include_number_compare_name = "_NO_NUMBER";
7053 }
7054
7055 OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
7056 "CompareStub_%s%s%s%s",
7057 cc_name,
7058 strict_name,
7059 never_nan_nan_name,
7060 include_number_compare_name);
7061 return name_;
7059 } 7062 }
7060 7063
7061 7064
7062 int CompareStub::MinorKey() { 7065 int CompareStub::MinorKey() {
7063 // Encode the three parameters in a unique 16 bit value. To avoid duplicate 7066 // Encode the three parameters in a unique 16 bit value. To avoid duplicate
7064 // stubs the never NaN NaN condition is only taken into account if the 7067 // stubs the never NaN NaN condition is only taken into account if the
7065 // condition is equals. 7068 // condition is equals.
7066 ASSERT((static_cast<unsigned>(cc_) >> 28) < (1 << 14)); 7069 ASSERT((static_cast<unsigned>(cc_) >> 28) < (1 << 13));
7067 return ConditionField::encode(static_cast<unsigned>(cc_) >> 28) 7070 return ConditionField::encode(static_cast<unsigned>(cc_) >> 28)
7068 | StrictField::encode(strict_) 7071 | StrictField::encode(strict_)
7069 | NeverNanNanField::encode(cc_ == eq ? never_nan_nan_ : false); 7072 | NeverNanNanField::encode(cc_ == eq ? never_nan_nan_ : false)
7073 | IncludeNumberCompareField::encode(include_number_compare_);
7070 } 7074 }
7071 7075
7072 7076
7073 void StringStubBase::GenerateCopyCharacters(MacroAssembler* masm, 7077 void StringStubBase::GenerateCopyCharacters(MacroAssembler* masm,
7074 Register dest, 7078 Register dest,
7075 Register src, 7079 Register src,
7076 Register count, 7080 Register count,
7077 Register scratch, 7081 Register scratch,
7078 bool ascii) { 7082 bool ascii) {
7079 Label loop; 7083 Label loop;
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
7945 7949
7946 // Just jump to runtime to add the two strings. 7950 // Just jump to runtime to add the two strings.
7947 __ bind(&string_add_runtime); 7951 __ bind(&string_add_runtime);
7948 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 7952 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
7949 } 7953 }
7950 7954
7951 7955
7952 #undef __ 7956 #undef __
7953 7957
7954 } } // namespace v8::internal 7958 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/codegen.h » ('j') | test/mjsunit/regress/regress-crbug-39160.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698