OLD | NEW |
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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 kind_ = COMPUTED; | 274 kind_ = COMPUTED; |
275 } | 275 } |
276 } | 276 } |
277 | 277 |
278 | 278 |
279 void ClassLiteral::AssignFeedbackVectorSlots(Isolate* isolate, | 279 void ClassLiteral::AssignFeedbackVectorSlots(Isolate* isolate, |
280 FeedbackVectorSpec* spec, | 280 FeedbackVectorSpec* spec, |
281 FeedbackVectorSlotCache* cache) { | 281 FeedbackVectorSlotCache* cache) { |
282 // This logic that computes the number of slots needed for vector store | 282 // This logic that computes the number of slots needed for vector store |
283 // ICs must mirror FullCodeGenerator::VisitClassLiteral. | 283 // ICs must mirror FullCodeGenerator::VisitClassLiteral. |
| 284 prototype_slot_ = spec->AddLoadICSlot(); |
284 if (NeedsProxySlot()) { | 285 if (NeedsProxySlot()) { |
285 slot_ = spec->AddStoreICSlot(); | 286 proxy_slot_ = spec->AddStoreICSlot(); |
286 } | 287 } |
287 | 288 |
288 for (int i = 0; i < properties()->length(); i++) { | 289 for (int i = 0; i < properties()->length(); i++) { |
289 ObjectLiteral::Property* property = properties()->at(i); | 290 ObjectLiteral::Property* property = properties()->at(i); |
290 Expression* value = property->value(); | 291 Expression* value = property->value(); |
291 if (FunctionLiteral::NeedsHomeObject(value)) { | 292 if (FunctionLiteral::NeedsHomeObject(value)) { |
292 property->SetSlot(spec->AddStoreICSlot()); | 293 property->SetSlot(spec->AddStoreICSlot()); |
293 } | 294 } |
294 } | 295 } |
295 } | 296 } |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 bool Literal::Match(void* literal1, void* literal2) { | 838 bool Literal::Match(void* literal1, void* literal2) { |
838 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 839 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
839 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 840 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
840 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 841 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
841 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 842 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
842 } | 843 } |
843 | 844 |
844 | 845 |
845 } // namespace internal | 846 } // namespace internal |
846 } // namespace v8 | 847 } // namespace v8 |
OLD | NEW |