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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
463 void EmitLoadGlobalCheckExtensions(Variable* var, | 463 void EmitLoadGlobalCheckExtensions(Variable* var, |
464 TypeofState typeof_state, | 464 TypeofState typeof_state, |
465 Label* slow); | 465 Label* slow); |
466 MemOperand ContextSlotOperandCheckExtensions(Variable* var, Label* slow); | 466 MemOperand ContextSlotOperandCheckExtensions(Variable* var, Label* slow); |
467 void EmitDynamicLookupFastCase(Variable* var, | 467 void EmitDynamicLookupFastCase(Variable* var, |
468 TypeofState typeof_state, | 468 TypeofState typeof_state, |
469 Label* slow, | 469 Label* slow, |
470 Label* done); | 470 Label* done); |
471 void EmitVariableLoad(VariableProxy* proxy); | 471 void EmitVariableLoad(VariableProxy* proxy); |
472 | 472 |
473 void EmitAccessor(Expression* expression); | |
474 | |
473 // Expects the arguments and the function already pushed. | 475 // Expects the arguments and the function already pushed. |
474 void EmitResolvePossiblyDirectEval(int arg_count); | 476 void EmitResolvePossiblyDirectEval(int arg_count); |
475 | 477 |
476 // Platform-specific support for allocating a new closure based on | 478 // Platform-specific support for allocating a new closure based on |
477 // the given function info. | 479 // the given function info. |
478 void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure); | 480 void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure); |
479 | 481 |
480 // Platform-specific support for compiling assignments. | 482 // Platform-specific support for compiling assignments. |
481 | 483 |
482 // Load a value from a named property. | 484 // Load a value from a named property. |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
797 bool has_self_optimization_header_; | 799 bool has_self_optimization_header_; |
798 Handle<FixedArray> handler_table_; | 800 Handle<FixedArray> handler_table_; |
799 Handle<JSGlobalPropertyCell> profiling_counter_; | 801 Handle<JSGlobalPropertyCell> profiling_counter_; |
800 | 802 |
801 friend class NestedStatement; | 803 friend class NestedStatement; |
802 | 804 |
803 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 805 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
804 }; | 806 }; |
805 | 807 |
806 | 808 |
809 // A map from property names to getter/setter pairs allocated in the zone. | |
810 class AccessorTable: public TemplateHashMap<Literal, | |
811 ObjectLiteral::Accessors, | |
812 ZoneListAllocationPolicy> { | |
813 public: | |
814 explicit AccessorTable(Zone* zone) : | |
815 TemplateHashMap<Literal, | |
816 ObjectLiteral::Accessors, | |
817 ZoneListAllocationPolicy>(Literal::Match), | |
818 zone_(zone) { } | |
819 | |
820 Iterator lookup(Literal* literal) { | |
rossberg
2012/03/14 16:29:03
Nit: Shouldn't this be called 'find' and have the
Sven Panne
2012/03/15 07:12:57
In a language with lazy evaluation, yes. In C++ we
| |
821 Iterator it = find(literal, true); | |
822 if (it->second == NULL) it->second = new(zone_) ObjectLiteral::Accessors(); | |
823 return it; | |
824 } | |
825 | |
826 private: | |
827 Zone* zone_; | |
828 }; | |
829 | |
830 | |
807 } } // namespace v8::internal | 831 } } // namespace v8::internal |
808 | 832 |
809 #endif // V8_FULL_CODEGEN_H_ | 833 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |