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

Side by Side Diff: src/ast.cc

Issue 5753005: Make closures optimizable by Crankshaft compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Next round Created 9 years, 11 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/ast.h ('k') | src/compiler.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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 return Token::ILLEGAL; 160 return Token::ILLEGAL;
161 } 161 }
162 162
163 163
164 bool FunctionLiteral::AllowsLazyCompilation() { 164 bool FunctionLiteral::AllowsLazyCompilation() {
165 return scope()->AllowsLazyCompilation(); 165 return scope()->AllowsLazyCompilation();
166 } 166 }
167 167
168 168
169 bool FunctionLiteral::AllowOptimize() {
170 // We can't deal with heap-allocated locals.
171 return scope()->num_heap_slots() == 0;
172 }
173
174
175 ObjectLiteral::Property::Property(Literal* key, Expression* value) { 169 ObjectLiteral::Property::Property(Literal* key, Expression* value) {
176 emit_store_ = true; 170 emit_store_ = true;
177 key_ = key; 171 key_ = key;
178 value_ = value; 172 value_ = value;
179 Object* k = *key->handle(); 173 Object* k = *key->handle();
180 if (k->IsSymbol() && Heap::Proto_symbol()->Equals(String::cast(k))) { 174 if (k->IsSymbol() && Heap::Proto_symbol()->Equals(String::cast(k))) {
181 kind_ = PROTOTYPE; 175 kind_ = PROTOTYPE;
182 } else if (value_->AsMaterializedLiteral() != NULL) { 176 } else if (value_->AsMaterializedLiteral() != NULL) {
183 kind_ = MATERIALIZED_LITERAL; 177 kind_ = MATERIALIZED_LITERAL;
184 } else if (value_->AsLiteral() != NULL) { 178 } else if (value_->AsLiteral() != NULL) {
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 1048
1055 CaseClause::CaseClause(Expression* label, 1049 CaseClause::CaseClause(Expression* label,
1056 ZoneList<Statement*>* statements, 1050 ZoneList<Statement*>* statements,
1057 int pos) 1051 int pos)
1058 : label_(label), 1052 : label_(label),
1059 statements_(statements), 1053 statements_(statements),
1060 position_(pos), 1054 position_(pos),
1061 compare_type_(NONE) {} 1055 compare_type_(NONE) {}
1062 1056
1063 } } // namespace v8::internal 1057 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698