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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 HEnvironment* CopyWithoutHistory() const; | 545 HEnvironment* CopyWithoutHistory() const; |
546 HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; | 546 HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; |
547 | 547 |
548 // Create an "inlined version" of this environment, where the original | 548 // Create an "inlined version" of this environment, where the original |
549 // environment is the outer environment but the top expression stack | 549 // environment is the outer environment but the top expression stack |
550 // elements are moved to an inner environment as parameters. | 550 // elements are moved to an inner environment as parameters. |
551 HEnvironment* CopyForInlining(Handle<JSFunction> target, | 551 HEnvironment* CopyForInlining(Handle<JSFunction> target, |
552 int arguments, | 552 int arguments, |
553 FunctionLiteral* function, | 553 FunctionLiteral* function, |
554 HConstant* undefined, | 554 HConstant* undefined, |
555 CallKind call_kind, | 555 InliningKind inlining_kind, |
556 InliningKind inlining_kind) const; | 556 bool undefined_receiver) const; |
| 557 |
| 558 static bool UseUndefinedReceiver(Handle<JSFunction> closure, |
| 559 FunctionLiteral* function, |
| 560 CallKind call_kind, |
| 561 InliningKind inlining_kind) { |
| 562 return (closure->shared()->native() || !function->is_classic_mode()) && |
| 563 call_kind == CALL_AS_FUNCTION && inlining_kind != CONSTRUCT_CALL_RETURN; |
| 564 } |
557 | 565 |
558 HEnvironment* DiscardInlined(bool drop_extra) { | 566 HEnvironment* DiscardInlined(bool drop_extra) { |
559 HEnvironment* outer = outer_; | 567 HEnvironment* outer = outer_; |
560 while (outer->frame_type() != JS_FUNCTION) outer = outer->outer_; | 568 while (outer->frame_type() != JS_FUNCTION) outer = outer->outer_; |
561 if (drop_extra) outer->Drop(1); | 569 if (drop_extra) outer->Drop(1); |
562 return outer; | 570 return outer; |
563 } | 571 } |
564 | 572 |
565 void AddIncomingEdge(HBasicBlock* block, HEnvironment* other); | 573 void AddIncomingEdge(HBasicBlock* block, HEnvironment* other); |
566 | 574 |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 const char* filename_; | 1575 const char* filename_; |
1568 HeapStringAllocator string_allocator_; | 1576 HeapStringAllocator string_allocator_; |
1569 StringStream trace_; | 1577 StringStream trace_; |
1570 int indent_; | 1578 int indent_; |
1571 }; | 1579 }; |
1572 | 1580 |
1573 | 1581 |
1574 } } // namespace v8::internal | 1582 } } // namespace v8::internal |
1575 | 1583 |
1576 #endif // V8_HYDROGEN_H_ | 1584 #endif // V8_HYDROGEN_H_ |
OLD | NEW |