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

Side by Side Diff: src/hydrogen.cc

Issue 14471041: Implement support for Math.imul in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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/hydrogen-instructions.h » ('j') | src/math.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 8700 matching lines...) Expand 10 before | Expand all | Expand 10 after
8711 HValue* context = environment()->LookupContext(); 8711 HValue* context = environment()->LookupContext();
8712 Drop(1); // Receiver. 8712 Drop(1); // Receiver.
8713 HInstruction* op = 8713 HInstruction* op =
8714 HUnaryMathOperation::New(zone(), context, argument, id); 8714 HUnaryMathOperation::New(zone(), context, argument, id);
8715 op->set_position(expr->position()); 8715 op->set_position(expr->position());
8716 if (drop_extra) Drop(1); // Optionally drop the function. 8716 if (drop_extra) Drop(1); // Optionally drop the function.
8717 ast_context()->ReturnInstruction(op, expr->id()); 8717 ast_context()->ReturnInstruction(op, expr->id());
8718 return true; 8718 return true;
8719 } 8719 }
8720 break; 8720 break;
8721 case kMathImul:
8722 if (expr->arguments()->length() == 2) {
8723 HValue* right = Pop();
8724 HValue* left = Pop();
8725 Drop(1); // Receiver.
8726 HValue* context = environment()->LookupContext();
8727 HInstruction* op = HMul::NewImul(zone(), context, left, right);
8728 if (drop_extra) Drop(1); // Optionally drop the function.
8729 ast_context()->ReturnInstruction(op, expr->id());
8730 return true;
8731 }
8732 break;
8721 default: 8733 default:
8722 // Not supported for inlining yet. 8734 // Not supported for inlining yet.
8723 break; 8735 break;
8724 } 8736 }
8725 return false; 8737 return false;
8726 } 8738 }
8727 8739
8728 8740
8729 bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall( 8741 bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
8730 Call* expr, 8742 Call* expr,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
8858 Drop(1); // Receiver. 8870 Drop(1); // Receiver.
8859 HValue* context = environment()->LookupContext(); 8871 HValue* context = environment()->LookupContext();
8860 HMathMinMax::Operation op = (id == kMathMin) ? HMathMinMax::kMathMin 8872 HMathMinMax::Operation op = (id == kMathMin) ? HMathMinMax::kMathMin
8861 : HMathMinMax::kMathMax; 8873 : HMathMinMax::kMathMax;
8862 HInstruction* result = 8874 HInstruction* result =
8863 HMathMinMax::New(zone(), context, left, right, op); 8875 HMathMinMax::New(zone(), context, left, right, op);
8864 ast_context()->ReturnInstruction(result, expr->id()); 8876 ast_context()->ReturnInstruction(result, expr->id());
8865 return true; 8877 return true;
8866 } 8878 }
8867 break; 8879 break;
8880 case kMathImul:
8881 if (argument_count == 3 && check_type == RECEIVER_MAP_CHECK) {
8882 AddCheckConstantFunction(expr->holder(), receiver, receiver_map);
8883 HValue* right = Pop();
8884 HValue* left = Pop();
8885 Drop(1); // Receiver.
8886 HValue* context = environment()->LookupContext();
8887 HInstruction* result = HMul::NewImul(zone(), context, left, right);
8888 ast_context()->ReturnInstruction(result, expr->id());
8889 return true;
8890 }
8891 break;
8868 default: 8892 default:
8869 // Not yet supported for inlining. 8893 // Not yet supported for inlining.
8870 break; 8894 break;
8871 } 8895 }
8872 return false; 8896 return false;
8873 } 8897 }
8874 8898
8875 8899
8876 bool HOptimizedGraphBuilder::TryCallApply(Call* expr) { 8900 bool HOptimizedGraphBuilder::TryCallApply(Call* expr) {
8877 Expression* callee = expr->expression(); 8901 Expression* callee = expr->expression();
(...skipping 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after
11919 } 11943 }
11920 } 11944 }
11921 11945
11922 #ifdef DEBUG 11946 #ifdef DEBUG
11923 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11947 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11924 if (allocator_ != NULL) allocator_->Verify(); 11948 if (allocator_ != NULL) allocator_->Verify();
11925 #endif 11949 #endif
11926 } 11950 }
11927 11951
11928 } } // namespace v8::internal 11952 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/math.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698