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

Side by Side Diff: src/x64/codegen-x64.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/x64/codegen-x64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 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 7354 matching lines...) Expand 10 before | Expand all | Expand 10 after
7365 __ JumpIfSmi(rax, &done); // argument in rax is OK 7365 __ JumpIfSmi(rax, &done); // argument in rax is OK
7366 __ Cmp(FieldOperand(rax, HeapObject::kMapOffset), Factory::heap_number_map()); 7366 __ Cmp(FieldOperand(rax, HeapObject::kMapOffset), Factory::heap_number_map());
7367 __ j(not_equal, non_float); // The argument in rax is not a number. 7367 __ j(not_equal, non_float); // The argument in rax is not a number.
7368 7368
7369 // Fall-through: Both operands are numbers. 7369 // Fall-through: Both operands are numbers.
7370 __ bind(&done); 7370 __ bind(&done);
7371 } 7371 }
7372 7372
7373 7373
7374 const char* GenericBinaryOpStub::GetName() { 7374 const char* GenericBinaryOpStub::GetName() {
7375 switch (op_) { 7375 if (name_ != NULL) return name_;
7376 case Token::ADD: return "GenericBinaryOpStub_ADD"; 7376 const int len = 100;
7377 case Token::SUB: return "GenericBinaryOpStub_SUB"; 7377 name_ = Bootstrapper::AllocateAutoDeletedArray(len);
7378 case Token::MUL: return "GenericBinaryOpStub_MUL"; 7378 if (name_ == NULL) return "OOM";
7379 case Token::DIV: return "GenericBinaryOpStub_DIV"; 7379 const char* op_name = Token::Name(op_);
7380 case Token::BIT_OR: return "GenericBinaryOpStub_BIT_OR"; 7380 const char* overwrite_name;
7381 case Token::BIT_AND: return "GenericBinaryOpStub_BIT_AND"; 7381 switch (mode_) {
7382 case Token::BIT_XOR: return "GenericBinaryOpStub_BIT_XOR"; 7382 case NO_OVERWRITE: overwrite_name = "Alloc"; break;
7383 case Token::SAR: return "GenericBinaryOpStub_SAR"; 7383 case OVERWRITE_RIGHT: overwrite_name = "OverwriteRight"; break;
7384 case Token::SHL: return "GenericBinaryOpStub_SHL"; 7384 case OVERWRITE_LEFT: overwrite_name = "OverwriteLeft"; break;
7385 case Token::SHR: return "GenericBinaryOpStub_SHR"; 7385 default: overwrite_name = "UnknownOverwrite"; break;
7386 default: return "GenericBinaryOpStub";
7387 } 7386 }
7387
7388 OS::SNPrintF(Vector<char>(name_, len),
7389 "GenericBinaryOpStub_%s_%s%s_%s%s_%s",
7390 op_name,
7391 overwrite_name,
7392 (flags_ & NO_SMI_CODE_IN_STUB) ? "_NoSmiInStub" : "",
7393 args_in_registers_ ? "RegArgs" : "StackArgs",
7394 args_reversed_ ? "_R" : "",
7395 use_sse3_ ? "SSE3" : "SSE2");
7396 return name_;
7388 } 7397 }
7389 7398
7390 7399
7391 void GenericBinaryOpStub::GenerateCall( 7400 void GenericBinaryOpStub::GenerateCall(
7392 MacroAssembler* masm, 7401 MacroAssembler* masm,
7393 Register left, 7402 Register left,
7394 Register right) { 7403 Register right) {
7395 if (!ArgsInRegistersSupported()) { 7404 if (!ArgsInRegistersSupported()) {
7396 // Pass arguments on the stack. 7405 // Pass arguments on the stack.
7397 __ push(left); 7406 __ push(left);
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
8198 masm.GetCode(&desc); 8207 masm.GetCode(&desc);
8199 // Call the function from C++. 8208 // Call the function from C++.
8200 return FUNCTION_CAST<ModuloFunction>(buffer); 8209 return FUNCTION_CAST<ModuloFunction>(buffer);
8201 } 8210 }
8202 8211
8203 #endif 8212 #endif
8204 8213
8205 #undef __ 8214 #undef __
8206 8215
8207 } } // namespace v8::internal 8216 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698