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

Side by Side Diff: src/ast.h

Issue 6240012: Optimize calls to object literal properties that are initialized with a funct... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: rebased and fixed lintos Created 9 years, 9 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/arm/lithium-codegen-arm.cc ('k') | src/handles.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 Expression* value_; 978 Expression* value_;
979 Kind kind_; 979 Kind kind_;
980 bool emit_store_; 980 bool emit_store_;
981 }; 981 };
982 982
983 ObjectLiteral(Handle<FixedArray> constant_properties, 983 ObjectLiteral(Handle<FixedArray> constant_properties,
984 ZoneList<Property*>* properties, 984 ZoneList<Property*>* properties,
985 int literal_index, 985 int literal_index,
986 bool is_simple, 986 bool is_simple,
987 bool fast_elements, 987 bool fast_elements,
988 int depth) 988 int depth,
989 bool has_function)
989 : MaterializedLiteral(literal_index, is_simple, depth), 990 : MaterializedLiteral(literal_index, is_simple, depth),
990 constant_properties_(constant_properties), 991 constant_properties_(constant_properties),
991 properties_(properties), 992 properties_(properties),
992 fast_elements_(fast_elements) {} 993 fast_elements_(fast_elements),
994 has_function_(has_function) {}
993 995
994 DECLARE_NODE_TYPE(ObjectLiteral) 996 DECLARE_NODE_TYPE(ObjectLiteral)
995 997
996 Handle<FixedArray> constant_properties() const { 998 Handle<FixedArray> constant_properties() const {
997 return constant_properties_; 999 return constant_properties_;
998 } 1000 }
999 ZoneList<Property*>* properties() const { return properties_; } 1001 ZoneList<Property*>* properties() const { return properties_; }
1000 1002
1001 bool fast_elements() const { return fast_elements_; } 1003 bool fast_elements() const { return fast_elements_; }
1002 1004
1005 bool has_function() { return has_function_; }
1003 1006
1004 // Mark all computed expressions that are bound to a key that 1007 // Mark all computed expressions that are bound to a key that
1005 // is shadowed by a later occurrence of the same key. For the 1008 // is shadowed by a later occurrence of the same key. For the
1006 // marked expressions, no store code is emitted. 1009 // marked expressions, no store code is emitted.
1007 void CalculateEmitStore(); 1010 void CalculateEmitStore();
1008 1011
1012 enum Flags {
1013 kNoFlags = 0,
1014 kFastElements = 1,
1015 kHasFunction = 1 << 1
1016 };
1017
1009 private: 1018 private:
1010 Handle<FixedArray> constant_properties_; 1019 Handle<FixedArray> constant_properties_;
1011 ZoneList<Property*>* properties_; 1020 ZoneList<Property*>* properties_;
1012 bool fast_elements_; 1021 bool fast_elements_;
1022 bool has_function_;
1013 }; 1023 };
1014 1024
1015 1025
1016 // Node for capturing a regexp literal. 1026 // Node for capturing a regexp literal.
1017 class RegExpLiteral: public MaterializedLiteral { 1027 class RegExpLiteral: public MaterializedLiteral {
1018 public: 1028 public:
1019 RegExpLiteral(Handle<String> pattern, 1029 RegExpLiteral(Handle<String> pattern,
1020 Handle<String> flags, 1030 Handle<String> flags,
1021 int literal_index) 1031 int literal_index)
1022 : MaterializedLiteral(literal_index, false, 1), 1032 : MaterializedLiteral(literal_index, false, 1),
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 #undef DEF_VISIT 2221 #undef DEF_VISIT
2212 2222
2213 private: 2223 private:
2214 bool stack_overflow_; 2224 bool stack_overflow_;
2215 }; 2225 };
2216 2226
2217 2227
2218 } } // namespace v8::internal 2228 } } // namespace v8::internal
2219 2229
2220 #endif // V8_AST_H_ 2230 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698