| OLD | NEW | 
|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 | 8 | 
| 9 #include "src/v8.h" | 9 #include "src/v8.h" | 
| 10 | 10 | 
| (...skipping 8054 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 8065 | 8065 | 
| 8066 | 8066 | 
| 8067 bool HOptimizedGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr) { | 8067 bool HOptimizedGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr) { | 
| 8068   if (!expr->target()->shared()->HasBuiltinFunctionId()) return false; | 8068   if (!expr->target()->shared()->HasBuiltinFunctionId()) return false; | 
| 8069   BuiltinFunctionId id = expr->target()->shared()->builtin_function_id(); | 8069   BuiltinFunctionId id = expr->target()->shared()->builtin_function_id(); | 
| 8070   switch (id) { | 8070   switch (id) { | 
| 8071     case kMathExp: | 8071     case kMathExp: | 
| 8072       if (!FLAG_fast_math) break; | 8072       if (!FLAG_fast_math) break; | 
| 8073       // Fall through if FLAG_fast_math. | 8073       // Fall through if FLAG_fast_math. | 
| 8074     case kMathRound: | 8074     case kMathRound: | 
|  | 8075     case kMathFround: | 
| 8075     case kMathFloor: | 8076     case kMathFloor: | 
| 8076     case kMathAbs: | 8077     case kMathAbs: | 
| 8077     case kMathSqrt: | 8078     case kMathSqrt: | 
| 8078     case kMathLog: | 8079     case kMathLog: | 
| 8079     case kMathClz32: | 8080     case kMathClz32: | 
| 8080       if (expr->arguments()->length() == 1) { | 8081       if (expr->arguments()->length() == 1) { | 
| 8081         HValue* argument = Pop(); | 8082         HValue* argument = Pop(); | 
| 8082         Drop(2);  // Receiver and function. | 8083         Drop(2);  // Receiver and function. | 
| 8083         HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id); | 8084         HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id); | 
| 8084         ast_context()->ReturnInstruction(op, expr->id()); | 8085         ast_context()->ReturnInstruction(op, expr->id()); | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 8136         Drop(2);  // Receiver and function. | 8137         Drop(2);  // Receiver and function. | 
| 8137         HInstruction* result = NewUncasted<HStringCharFromCode>(argument); | 8138         HInstruction* result = NewUncasted<HStringCharFromCode>(argument); | 
| 8138         ast_context()->ReturnInstruction(result, expr->id()); | 8139         ast_context()->ReturnInstruction(result, expr->id()); | 
| 8139         return true; | 8140         return true; | 
| 8140       } | 8141       } | 
| 8141       break; | 8142       break; | 
| 8142     case kMathExp: | 8143     case kMathExp: | 
| 8143       if (!FLAG_fast_math) break; | 8144       if (!FLAG_fast_math) break; | 
| 8144       // Fall through if FLAG_fast_math. | 8145       // Fall through if FLAG_fast_math. | 
| 8145     case kMathRound: | 8146     case kMathRound: | 
|  | 8147     case kMathFround: | 
| 8146     case kMathFloor: | 8148     case kMathFloor: | 
| 8147     case kMathAbs: | 8149     case kMathAbs: | 
| 8148     case kMathSqrt: | 8150     case kMathSqrt: | 
| 8149     case kMathLog: | 8151     case kMathLog: | 
| 8150     case kMathClz32: | 8152     case kMathClz32: | 
| 8151       if (argument_count == 2) { | 8153       if (argument_count == 2) { | 
| 8152         HValue* argument = Pop(); | 8154         HValue* argument = Pop(); | 
| 8153         Drop(2);  // Receiver and function. | 8155         Drop(2);  // Receiver and function. | 
| 8154         HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id); | 8156         HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id); | 
| 8155         ast_context()->ReturnInstruction(op, expr->id()); | 8157         ast_context()->ReturnInstruction(op, expr->id()); | 
| (...skipping 4319 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 12475   if (ShouldProduceTraceOutput()) { | 12477   if (ShouldProduceTraceOutput()) { | 
| 12476     isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12478     isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 
| 12477   } | 12479   } | 
| 12478 | 12480 | 
| 12479 #ifdef DEBUG | 12481 #ifdef DEBUG | 
| 12480   graph_->Verify(false);  // No full verify. | 12482   graph_->Verify(false);  // No full verify. | 
| 12481 #endif | 12483 #endif | 
| 12482 } | 12484 } | 
| 12483 | 12485 | 
| 12484 } }  // namespace v8::internal | 12486 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|