OLD | NEW |
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 3915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3926 Result value = frame_->Pop(); | 3926 Result value = frame_->Pop(); |
3927 value.ToRegister(); | 3927 value.ToRegister(); |
3928 ASSERT(value.is_valid()); | 3928 ASSERT(value.is_valid()); |
3929 Condition positive_smi = masm_->CheckPositiveSmi(value.reg()); | 3929 Condition positive_smi = masm_->CheckPositiveSmi(value.reg()); |
3930 value.Unuse(); | 3930 value.Unuse(); |
3931 destination()->Split(positive_smi); | 3931 destination()->Split(positive_smi); |
3932 } | 3932 } |
3933 | 3933 |
3934 | 3934 |
3935 // Generates the Math.pow method - currently just calls runtime. | 3935 // Generates the Math.pow method - currently just calls runtime. |
3936 void CodeGenerator::GeneratePow(ZoneList<Expression*>* args) { | 3936 void CodeGenerator::GenerateMathPow(ZoneList<Expression*>* args) { |
3937 ASSERT(args->length() == 2); | 3937 ASSERT(args->length() == 2); |
3938 Load(args->at(0)); | 3938 Load(args->at(0)); |
3939 Load(args->at(1)); | 3939 Load(args->at(1)); |
3940 Result res = frame_->CallRuntime(Runtime::kMath_pow, 2); | 3940 Result res = frame_->CallRuntime(Runtime::kMath_pow, 2); |
3941 frame_->Push(&res); | 3941 frame_->Push(&res); |
3942 } | 3942 } |
3943 | 3943 |
3944 | 3944 |
| 3945 // Generates the Math.sqrt method - currently just calls runtime. |
| 3946 void CodeGenerator::GenerateMathSqrt(ZoneList<Expression*>* args) { |
| 3947 ASSERT(args->length() == 1); |
| 3948 Load(args->at(0)); |
| 3949 Result res = frame_->CallRuntime(Runtime::kMath_sqrt, 1); |
| 3950 frame_->Push(&res); |
| 3951 } |
| 3952 |
| 3953 |
3945 void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) { | 3954 void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) { |
3946 ASSERT(args->length() == 1); | 3955 ASSERT(args->length() == 1); |
3947 Load(args->at(0)); | 3956 Load(args->at(0)); |
3948 Result value = frame_->Pop(); | 3957 Result value = frame_->Pop(); |
3949 value.ToRegister(); | 3958 value.ToRegister(); |
3950 ASSERT(value.is_valid()); | 3959 ASSERT(value.is_valid()); |
3951 Condition is_smi = masm_->CheckSmi(value.reg()); | 3960 Condition is_smi = masm_->CheckSmi(value.reg()); |
3952 value.Unuse(); | 3961 value.Unuse(); |
3953 destination()->Split(is_smi); | 3962 destination()->Split(is_smi); |
3954 } | 3963 } |
(...skipping 5832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9787 // Call the function from C++. | 9796 // Call the function from C++. |
9788 return FUNCTION_CAST<ModuloFunction>(buffer); | 9797 return FUNCTION_CAST<ModuloFunction>(buffer); |
9789 } | 9798 } |
9790 | 9799 |
9791 #endif | 9800 #endif |
9792 | 9801 |
9793 | 9802 |
9794 #undef __ | 9803 #undef __ |
9795 | 9804 |
9796 } } // namespace v8::internal | 9805 } } // namespace v8::internal |
OLD | NEW |