OLD | NEW |
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 7235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7246 assignment->id(), | 7246 assignment->id(), |
7247 assignment->AssignmentId(), | 7247 assignment->AssignmentId(), |
7248 SETTER_CALL_RETURN); | 7248 SETTER_CALL_RETURN); |
7249 } | 7249 } |
7250 | 7250 |
7251 | 7251 |
7252 bool HGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr, bool drop_extra) { | 7252 bool HGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr, bool drop_extra) { |
7253 if (!expr->target()->shared()->HasBuiltinFunctionId()) return false; | 7253 if (!expr->target()->shared()->HasBuiltinFunctionId()) return false; |
7254 BuiltinFunctionId id = expr->target()->shared()->builtin_function_id(); | 7254 BuiltinFunctionId id = expr->target()->shared()->builtin_function_id(); |
7255 switch (id) { | 7255 switch (id) { |
| 7256 case kMathExp: |
| 7257 if (!FLAG_fast_math) break; |
| 7258 // Fall through if FLAG_fast_math. |
7256 case kMathRound: | 7259 case kMathRound: |
7257 case kMathAbs: | 7260 case kMathAbs: |
7258 case kMathSqrt: | 7261 case kMathSqrt: |
7259 case kMathLog: | 7262 case kMathLog: |
7260 case kMathSin: | 7263 case kMathSin: |
7261 case kMathCos: | 7264 case kMathCos: |
7262 case kMathTan: | 7265 case kMathTan: |
7263 if (expr->arguments()->length() == 1) { | 7266 if (expr->arguments()->length() == 1) { |
7264 HValue* argument = Pop(); | 7267 HValue* argument = Pop(); |
7265 HValue* context = environment()->LookupContext(); | 7268 HValue* context = environment()->LookupContext(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7306 ast_context()->ReturnInstruction(char_code, expr->id()); | 7309 ast_context()->ReturnInstruction(char_code, expr->id()); |
7307 return true; | 7310 return true; |
7308 } | 7311 } |
7309 AddInstruction(char_code); | 7312 AddInstruction(char_code); |
7310 HStringCharFromCode* result = | 7313 HStringCharFromCode* result = |
7311 new(zone()) HStringCharFromCode(context, char_code); | 7314 new(zone()) HStringCharFromCode(context, char_code); |
7312 ast_context()->ReturnInstruction(result, expr->id()); | 7315 ast_context()->ReturnInstruction(result, expr->id()); |
7313 return true; | 7316 return true; |
7314 } | 7317 } |
7315 break; | 7318 break; |
| 7319 case kMathExp: |
| 7320 if (!FLAG_fast_math) break; |
| 7321 // Fall through if FLAG_fast_math. |
7316 case kMathRound: | 7322 case kMathRound: |
7317 case kMathFloor: | 7323 case kMathFloor: |
7318 case kMathAbs: | 7324 case kMathAbs: |
7319 case kMathSqrt: | 7325 case kMathSqrt: |
7320 case kMathLog: | 7326 case kMathLog: |
7321 case kMathSin: | 7327 case kMathSin: |
7322 case kMathCos: | 7328 case kMathCos: |
7323 case kMathTan: | 7329 case kMathTan: |
7324 if (argument_count == 2 && check_type == RECEIVER_MAP_CHECK) { | 7330 if (argument_count == 2 && check_type == RECEIVER_MAP_CHECK) { |
7325 AddCheckConstantFunction(expr->holder(), receiver, receiver_map); | 7331 AddCheckConstantFunction(expr->holder(), receiver, receiver_map); |
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10053 } | 10059 } |
10054 } | 10060 } |
10055 | 10061 |
10056 #ifdef DEBUG | 10062 #ifdef DEBUG |
10057 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10063 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
10058 if (allocator_ != NULL) allocator_->Verify(); | 10064 if (allocator_ != NULL) allocator_->Verify(); |
10059 #endif | 10065 #endif |
10060 } | 10066 } |
10061 | 10067 |
10062 } } // namespace v8::internal | 10068 } } // namespace v8::internal |
OLD | NEW |