OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 break; | 311 break; |
312 case Slot::CONTEXT: | 312 case Slot::CONTEXT: |
313 case Slot::LOOKUP: | 313 case Slot::LOOKUP: |
314 UNREACHABLE(); | 314 UNREACHABLE(); |
315 } | 315 } |
316 return offset; | 316 return offset; |
317 } | 317 } |
318 | 318 |
319 | 319 |
320 bool FullCodeGenerator::ShouldInlineSmiCase(Token::Value op) { | 320 bool FullCodeGenerator::ShouldInlineSmiCase(Token::Value op) { |
321 if (Debugger::IsDebuggerActive()) return false; | 321 // TODO(kasperl): Once the compare stub allows leaving out the |
322 if (op == Token::DIV ||op == Token::MOD) return false; | 322 // inlined smi case, we should get rid of this check. |
323 return loop_depth_ > 0; | 323 if (Token::IsCompareOp(op)) return true; |
| 324 // TODO(kasperl): Once the unary bit not stub allows leaving out |
| 325 // the inlined smi case, we should get rid of this check. |
| 326 if (op == Token::BIT_NOT) return true; |
| 327 // Inline smi case inside loops, but not division and modulo which |
| 328 // are too complicated and take up too much space. |
| 329 return (op != Token::DIV) && (op != Token::MOD) && (loop_depth_ > 0); |
324 } | 330 } |
325 | 331 |
326 | 332 |
327 void FullCodeGenerator::PrepareTest(Label* materialize_true, | 333 void FullCodeGenerator::PrepareTest(Label* materialize_true, |
328 Label* materialize_false, | 334 Label* materialize_false, |
329 Label** if_true, | 335 Label** if_true, |
330 Label** if_false, | 336 Label** if_false, |
331 Label** fall_through) { | 337 Label** fall_through) { |
332 switch (context_) { | 338 switch (context_) { |
333 case Expression::kUninitialized: | 339 case Expression::kUninitialized: |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 ASSERT(args->length() == 1); | 1107 ASSERT(args->length() == 1); |
1102 VisitForValue(args->at(0), kStack); | 1108 VisitForValue(args->at(0), kStack); |
1103 __ CallRuntime(Runtime::kRegExpCloneResult, 1); | 1109 __ CallRuntime(Runtime::kRegExpCloneResult, 1); |
1104 Apply(context_, result_register()); | 1110 Apply(context_, result_register()); |
1105 } | 1111 } |
1106 | 1112 |
1107 #undef __ | 1113 #undef __ |
1108 | 1114 |
1109 | 1115 |
1110 } } // namespace v8::internal | 1116 } } // namespace v8::internal |
OLD | NEW |