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

Side by Side Diff: src/ast/ast.cc

Issue 1712833002: Don't reflect ES2015 Function name inference in Function.prototype.toString (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move bits around to make STATIC_ASSERT happy Created 4 years, 10 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
« no previous file with comments | « src/ast/ast.h ('k') | src/globals.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ast/ast.h" 5 #include "src/ast/ast.h"
6 6
7 #include <cmath> // For isfinite. 7 #include <cmath> // For isfinite.
8 8
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 kind_ = PROTOTYPE; 268 kind_ = PROTOTYPE;
269 } else if (value_->AsMaterializedLiteral() != NULL) { 269 } else if (value_->AsMaterializedLiteral() != NULL) {
270 kind_ = MATERIALIZED_LITERAL; 270 kind_ = MATERIALIZED_LITERAL;
271 } else if (value_->IsLiteral()) { 271 } else if (value_->IsLiteral()) {
272 kind_ = CONSTANT; 272 kind_ = CONSTANT;
273 } else { 273 } else {
274 kind_ = COMPUTED; 274 kind_ = COMPUTED;
275 } 275 }
276 } 276 }
277 277
278 bool ObjectLiteralProperty::NeedsSetFunctionName() const {
279 return is_computed_name_ &&
280 (value_->IsAnonymousFunctionDefinition() ||
281 (value_->IsFunctionLiteral() &&
282 IsConciseMethod(value_->AsFunctionLiteral()->kind())));
283 }
278 284
279 void ClassLiteral::AssignFeedbackVectorSlots(Isolate* isolate, 285 void ClassLiteral::AssignFeedbackVectorSlots(Isolate* isolate,
280 FeedbackVectorSpec* spec, 286 FeedbackVectorSpec* spec,
281 FeedbackVectorSlotCache* cache) { 287 FeedbackVectorSlotCache* cache) {
282 // This logic that computes the number of slots needed for vector store 288 // This logic that computes the number of slots needed for vector store
283 // ICs must mirror FullCodeGenerator::VisitClassLiteral. 289 // ICs must mirror FullCodeGenerator::VisitClassLiteral.
284 prototype_slot_ = spec->AddLoadICSlot(); 290 prototype_slot_ = spec->AddLoadICSlot();
285 if (NeedsProxySlot()) { 291 if (NeedsProxySlot()) {
286 proxy_slot_ = spec->AddStoreICSlot(); 292 proxy_slot_ = spec->AddStoreICSlot();
287 } 293 }
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 bool Literal::Match(void* literal1, void* literal2) { 844 bool Literal::Match(void* literal1, void* literal2) {
839 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 845 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
840 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 846 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
841 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 847 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
842 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 848 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
843 } 849 }
844 850
845 851
846 } // namespace internal 852 } // namespace internal
847 } // namespace v8 853 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698