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

Side by Side Diff: src/ast.h

Issue 507036: Use one runtime call for creating object/array literals in... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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/arm/virtual-frame-arm.cc ('k') | src/ia32/codegen-ia32.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 820
821 private: 821 private:
822 Handle<String> pattern_; 822 Handle<String> pattern_;
823 Handle<String> flags_; 823 Handle<String> flags_;
824 }; 824 };
825 825
826 // An array literal has a literals object that is used 826 // An array literal has a literals object that is used
827 // for minimizing the work when constructing it at runtime. 827 // for minimizing the work when constructing it at runtime.
828 class ArrayLiteral: public MaterializedLiteral { 828 class ArrayLiteral: public MaterializedLiteral {
829 public: 829 public:
830 ArrayLiteral(Handle<FixedArray> literals, 830 ArrayLiteral(Handle<FixedArray> constant_elements,
831 ZoneList<Expression*>* values, 831 ZoneList<Expression*>* values,
832 int literal_index, 832 int literal_index,
833 bool is_simple, 833 bool is_simple,
834 int depth) 834 int depth)
835 : MaterializedLiteral(literal_index, is_simple, depth), 835 : MaterializedLiteral(literal_index, is_simple, depth),
836 literals_(literals), 836 constant_elements_(constant_elements),
837 values_(values) {} 837 values_(values) {}
838 838
839 virtual void Accept(AstVisitor* v); 839 virtual void Accept(AstVisitor* v);
840 virtual ArrayLiteral* AsArrayLiteral() { return this; } 840 virtual ArrayLiteral* AsArrayLiteral() { return this; }
841 virtual bool IsValidJSON(); 841 virtual bool IsValidJSON();
842 842
843 Handle<FixedArray> literals() const { return literals_; } 843 Handle<FixedArray> constant_elements() const { return constant_elements_; }
844 ZoneList<Expression*>* values() const { return values_; } 844 ZoneList<Expression*>* values() const { return values_; }
845 845
846 private: 846 private:
847 Handle<FixedArray> literals_; 847 Handle<FixedArray> constant_elements_;
848 ZoneList<Expression*>* values_; 848 ZoneList<Expression*>* values_;
849 }; 849 };
850 850
851 851
852 // Node for constructing a context extension object for a catch block. 852 // Node for constructing a context extension object for a catch block.
853 // The catch context extension object has one property, the catch 853 // The catch context extension object has one property, the catch
854 // variable, which should be DontDelete. 854 // variable, which should be DontDelete.
855 class CatchExtensionObject: public Expression { 855 class CatchExtensionObject: public Expression {
856 public: 856 public:
857 CatchExtensionObject(Literal* key, VariableProxy* value) 857 CatchExtensionObject(Literal* key, VariableProxy* value)
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 #undef DEF_VISIT 1792 #undef DEF_VISIT
1793 1793
1794 private: 1794 private:
1795 bool stack_overflow_; 1795 bool stack_overflow_;
1796 }; 1796 };
1797 1797
1798 1798
1799 } } // namespace v8::internal 1799 } } // namespace v8::internal
1800 1800
1801 #endif // V8_AST_H_ 1801 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm/virtual-frame-arm.cc ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698