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

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

Issue 660072: Added fast support for Math.pow. This simply calculates the result using the... (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
« src/ia32/codegen-ia32.cc ('K') | « 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 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 3873 matching lines...) Expand 10 before | Expand all | Expand 10 after
3884 Load(args->at(0)); 3884 Load(args->at(0));
3885 Result value = frame_->Pop(); 3885 Result value = frame_->Pop();
3886 value.ToRegister(); 3886 value.ToRegister();
3887 ASSERT(value.is_valid()); 3887 ASSERT(value.is_valid());
3888 Condition positive_smi = masm_->CheckPositiveSmi(value.reg()); 3888 Condition positive_smi = masm_->CheckPositiveSmi(value.reg());
3889 value.Unuse(); 3889 value.Unuse();
3890 destination()->Split(positive_smi); 3890 destination()->Split(positive_smi);
3891 } 3891 }
3892 3892
3893 3893
3894 // Generates the Math.pow method - currently just calls runtime.
3895 void CodeGenerator::GeneratePow(ZoneList<Expression*>* args) {
3896 ASSERT(args->length() == 2);
3897 Load(args->at(0));
3898 Load(args->at(1));
3899 Result res = frame_->CallRuntime(Runtime::kMath_pow, 2);
3900 frame_->Push(&res);
3901 }
3902
3903
3894 void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) { 3904 void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) {
3895 ASSERT(args->length() == 1); 3905 ASSERT(args->length() == 1);
3896 Load(args->at(0)); 3906 Load(args->at(0));
3897 Result value = frame_->Pop(); 3907 Result value = frame_->Pop();
3898 value.ToRegister(); 3908 value.ToRegister();
3899 ASSERT(value.is_valid()); 3909 ASSERT(value.is_valid());
3900 Condition is_smi = masm_->CheckSmi(value.reg()); 3910 Condition is_smi = masm_->CheckSmi(value.reg());
3901 value.Unuse(); 3911 value.Unuse();
3902 destination()->Split(is_smi); 3912 destination()->Split(is_smi);
3903 } 3913 }
(...skipping 5607 matching lines...) Expand 10 before | Expand all | Expand 10 after
9511 // Call the function from C++. 9521 // Call the function from C++.
9512 return FUNCTION_CAST<ModuloFunction>(buffer); 9522 return FUNCTION_CAST<ModuloFunction>(buffer);
9513 } 9523 }
9514 9524
9515 #endif 9525 #endif
9516 9526
9517 9527
9518 #undef __ 9528 #undef __
9519 9529
9520 } } // namespace v8::internal 9530 } } // namespace v8::internal
OLDNEW
« src/ia32/codegen-ia32.cc ('K') | « src/x64/codegen-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698