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

Side by Side Diff: src/hydrogen.cc

Issue 172133003: Harmony: optimize Math.clz32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 6 years, 10 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 | « src/bootstrapper.cc ('k') | src/hydrogen-instructions.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 7441 matching lines...) Expand 10 before | Expand all | Expand 10 after
7452 BuiltinFunctionId id = expr->target()->shared()->builtin_function_id(); 7452 BuiltinFunctionId id = expr->target()->shared()->builtin_function_id();
7453 switch (id) { 7453 switch (id) {
7454 case kMathExp: 7454 case kMathExp:
7455 if (!FLAG_fast_math) break; 7455 if (!FLAG_fast_math) break;
7456 // Fall through if FLAG_fast_math. 7456 // Fall through if FLAG_fast_math.
7457 case kMathRound: 7457 case kMathRound:
7458 case kMathFloor: 7458 case kMathFloor:
7459 case kMathAbs: 7459 case kMathAbs:
7460 case kMathSqrt: 7460 case kMathSqrt:
7461 case kMathLog: 7461 case kMathLog:
7462 case kMathClz32:
7462 if (expr->arguments()->length() == 1) { 7463 if (expr->arguments()->length() == 1) {
7463 HValue* argument = Pop(); 7464 HValue* argument = Pop();
7464 Drop(2); // Receiver and function. 7465 Drop(2); // Receiver and function.
7465 HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id); 7466 HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id);
7466 ast_context()->ReturnInstruction(op, expr->id()); 7467 ast_context()->ReturnInstruction(op, expr->id());
7467 return true; 7468 return true;
7468 } 7469 }
7469 break; 7470 break;
7470 case kMathImul: 7471 case kMathImul:
7471 if (expr->arguments()->length() == 2) { 7472 if (expr->arguments()->length() == 2) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
7522 } 7523 }
7523 break; 7524 break;
7524 case kMathExp: 7525 case kMathExp:
7525 if (!FLAG_fast_math) break; 7526 if (!FLAG_fast_math) break;
7526 // Fall through if FLAG_fast_math. 7527 // Fall through if FLAG_fast_math.
7527 case kMathRound: 7528 case kMathRound:
7528 case kMathFloor: 7529 case kMathFloor:
7529 case kMathAbs: 7530 case kMathAbs:
7530 case kMathSqrt: 7531 case kMathSqrt:
7531 case kMathLog: 7532 case kMathLog:
7533 case kMathClz32:
7532 if (argument_count == 2) { 7534 if (argument_count == 2) {
7533 HValue* argument = Pop(); 7535 HValue* argument = Pop();
7534 Drop(2); // Receiver and function. 7536 Drop(2); // Receiver and function.
7535 HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id); 7537 HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id);
7536 ast_context()->ReturnInstruction(op, expr->id()); 7538 ast_context()->ReturnInstruction(op, expr->id());
7537 return true; 7539 return true;
7538 } 7540 }
7539 break; 7541 break;
7540 case kMathPow: 7542 case kMathPow:
7541 if (argument_count == 3) { 7543 if (argument_count == 3) {
(...skipping 3748 matching lines...) Expand 10 before | Expand all | Expand 10 after
11290 if (ShouldProduceTraceOutput()) { 11292 if (ShouldProduceTraceOutput()) {
11291 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11293 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11292 } 11294 }
11293 11295
11294 #ifdef DEBUG 11296 #ifdef DEBUG
11295 graph_->Verify(false); // No full verify. 11297 graph_->Verify(false); // No full verify.
11296 #endif 11298 #endif
11297 } 11299 }
11298 11300
11299 } } // namespace v8::internal 11301 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698