Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: src/hydrogen.h

Issue 6691054: [Arguments] Merge (7442,7496] from bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 // have already been inserted in the instruction stream (or not need to 446 // have already been inserted in the instruction stream (or not need to
447 // be, e.g., HPhi). Call this function in tail position in the Visit 447 // be, e.g., HPhi). Call this function in tail position in the Visit
448 // functions for expressions. 448 // functions for expressions.
449 virtual void ReturnValue(HValue* value) = 0; 449 virtual void ReturnValue(HValue* value) = 0;
450 450
451 // Add a hydrogen instruction to the instruction stream (recording an 451 // Add a hydrogen instruction to the instruction stream (recording an
452 // environment simulation if necessary) and then fill this context with 452 // environment simulation if necessary) and then fill this context with
453 // the instruction as value. 453 // the instruction as value.
454 virtual void ReturnInstruction(HInstruction* instr, int ast_id) = 0; 454 virtual void ReturnInstruction(HInstruction* instr, int ast_id) = 0;
455 455
456 void set_for_typeof(bool for_typeof) { for_typeof_ = for_typeof; }
457 bool is_for_typeof() { return for_typeof_; }
458
456 protected: 459 protected:
457 AstContext(HGraphBuilder* owner, Expression::Context kind); 460 AstContext(HGraphBuilder* owner, Expression::Context kind);
458 virtual ~AstContext(); 461 virtual ~AstContext();
459 462
460 HGraphBuilder* owner() const { return owner_; } 463 HGraphBuilder* owner() const { return owner_; }
461 464
462 // We want to be able to assert, in a context-specific way, that the stack 465 // We want to be able to assert, in a context-specific way, that the stack
463 // height makes sense when the context is filled. 466 // height makes sense when the context is filled.
464 #ifdef DEBUG 467 #ifdef DEBUG
465 int original_length_; 468 int original_length_;
466 #endif 469 #endif
467 470
468 private: 471 private:
469 HGraphBuilder* owner_; 472 HGraphBuilder* owner_;
470 Expression::Context kind_; 473 Expression::Context kind_;
471 AstContext* outer_; 474 AstContext* outer_;
475 bool for_typeof_;
472 }; 476 };
473 477
474 478
475 class EffectContext: public AstContext { 479 class EffectContext: public AstContext {
476 public: 480 public:
477 explicit EffectContext(HGraphBuilder* owner) 481 explicit EffectContext(HGraphBuilder* owner)
478 : AstContext(owner, Expression::kEffect) { 482 : AstContext(owner, Expression::kEffect) {
479 } 483 }
480 virtual ~EffectContext(); 484 virtual ~EffectContext();
481 485
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 CompilationInfo* compilation_info() { return compilation_info_; } 541 CompilationInfo* compilation_info() { return compilation_info_; }
538 TypeFeedbackOracle* oracle() { return oracle_; } 542 TypeFeedbackOracle* oracle() { return oracle_; }
539 AstContext* call_context() { return call_context_; } 543 AstContext* call_context() { return call_context_; }
540 HBasicBlock* function_return() { return function_return_; } 544 HBasicBlock* function_return() { return function_return_; }
541 TestContext* test_context() { return test_context_; } 545 TestContext* test_context() { return test_context_; }
542 void ClearInlinedTestContext() { 546 void ClearInlinedTestContext() {
543 delete test_context_; 547 delete test_context_;
544 test_context_ = NULL; 548 test_context_ = NULL;
545 } 549 }
546 550
551 FunctionState* outer() { return outer_; }
552
547 private: 553 private:
548 HGraphBuilder* owner_; 554 HGraphBuilder* owner_;
549 555
550 CompilationInfo* compilation_info_; 556 CompilationInfo* compilation_info_;
551 TypeFeedbackOracle* oracle_; 557 TypeFeedbackOracle* oracle_;
552 558
553 // During function inlining, expression context of the call being 559 // During function inlining, expression context of the call being
554 // inlined. NULL when not inlining. 560 // inlined. NULL when not inlining.
555 AstContext* call_context_; 561 AstContext* call_context_;
556 562
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 734
729 HBasicBlock* JoinContinue(IterationStatement* statement, 735 HBasicBlock* JoinContinue(IterationStatement* statement,
730 HBasicBlock* exit_block, 736 HBasicBlock* exit_block,
731 HBasicBlock* continue_block); 737 HBasicBlock* continue_block);
732 738
733 HValue* Top() const { return environment()->Top(); } 739 HValue* Top() const { return environment()->Top(); }
734 void Drop(int n) { environment()->Drop(n); } 740 void Drop(int n) { environment()->Drop(n); }
735 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); } 741 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); }
736 742
737 void VisitForValue(Expression* expr); 743 void VisitForValue(Expression* expr);
744 void VisitForTypeOf(Expression* expr);
738 void VisitForEffect(Expression* expr); 745 void VisitForEffect(Expression* expr);
739 void VisitForControl(Expression* expr, 746 void VisitForControl(Expression* expr,
740 HBasicBlock* true_block, 747 HBasicBlock* true_block,
741 HBasicBlock* false_block); 748 HBasicBlock* false_block);
742 749
743 // Visit an argument subexpression and emit a push to the outgoing 750 // Visit an argument subexpression and emit a push to the outgoing
744 // arguments. 751 // arguments.
745 void VisitArgument(Expression* expr); 752 void VisitArgument(Expression* expr);
746 void VisitArgumentList(ZoneList<Expression*>* arguments); 753 void VisitArgumentList(ZoneList<Expression*>* arguments);
747 754
(...skipping 15 matching lines...) Expand all
763 virtual void VisitStatements(ZoneList<Statement*>* statements); 770 virtual void VisitStatements(ZoneList<Statement*>* statements);
764 771
765 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); 772 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
766 AST_NODE_LIST(DECLARE_VISIT) 773 AST_NODE_LIST(DECLARE_VISIT)
767 #undef DECLARE_VISIT 774 #undef DECLARE_VISIT
768 775
769 HBasicBlock* CreateBasicBlock(HEnvironment* env); 776 HBasicBlock* CreateBasicBlock(HEnvironment* env);
770 HBasicBlock* CreateLoopHeaderBlock(); 777 HBasicBlock* CreateLoopHeaderBlock();
771 778
772 // Helpers for flow graph construction. 779 // Helpers for flow graph construction.
773 void LookupGlobalPropertyCell(Variable* var, 780 enum GlobalPropertyAccess {
774 LookupResult* lookup, 781 kUseCell,
775 bool is_store); 782 kUseGeneric
783 };
784 GlobalPropertyAccess LookupGlobalProperty(Variable* var,
785 LookupResult* lookup,
786 bool is_store);
776 787
777 bool TryArgumentsAccess(Property* expr); 788 bool TryArgumentsAccess(Property* expr);
778 bool TryCallApply(Call* expr); 789 bool TryCallApply(Call* expr);
779 bool TryInline(Call* expr); 790 bool TryInline(Call* expr);
780 bool TryInlineBuiltinFunction(Call* expr, 791 bool TryInlineBuiltinFunction(Call* expr,
781 HValue* receiver, 792 HValue* receiver,
782 Handle<Map> receiver_map, 793 Handle<Map> receiver_map,
783 CheckType check_type); 794 CheckType check_type);
784 795
785 // If --trace-inlining, print a line of the inlining trace. Inlining 796 // If --trace-inlining, print a line of the inlining trace. Inlining
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 const char* filename_; 1110 const char* filename_;
1100 HeapStringAllocator string_allocator_; 1111 HeapStringAllocator string_allocator_;
1101 StringStream trace_; 1112 StringStream trace_;
1102 int indent_; 1113 int indent_;
1103 }; 1114 };
1104 1115
1105 1116
1106 } } // namespace v8::internal 1117 } } // namespace v8::internal
1107 1118
1108 #endif // V8_HYDROGEN_H_ 1119 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698