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

Side by Side Diff: src/ast.cc

Issue 758543002: Make use of post-scoping information to compute feedback vector requirements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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
« no previous file with comments | « src/ast.h ('k') | src/ast-numbering.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 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.h" 5 #include "src/ast.h"
6 6
7 #include <cmath> // For isfinite. 7 #include <cmath> // For isfinite.
8 #include "src/builtins.h" 8 #include "src/builtins.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/contexts.h" 10 #include "src/contexts.h"
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 set_to_boolean_types(oracle->ToBooleanTypes(test_id())); 566 set_to_boolean_types(oracle->ToBooleanTypes(test_id()));
567 } 567 }
568 568
569 569
570 bool Call::IsUsingCallFeedbackSlot(Isolate* isolate) const { 570 bool Call::IsUsingCallFeedbackSlot(Isolate* isolate) const {
571 CallType call_type = GetCallType(isolate); 571 CallType call_type = GetCallType(isolate);
572 return (call_type != POSSIBLY_EVAL_CALL); 572 return (call_type != POSSIBLY_EVAL_CALL);
573 } 573 }
574 574
575 575
576 FeedbackVectorRequirements Call::ComputeFeedbackRequirements(Isolate* isolate) {
577 int ic_slots = IsUsingCallFeedbackSlot(isolate) ? 1 : 0;
578 return FeedbackVectorRequirements(0, ic_slots);
579 }
580
581
576 Call::CallType Call::GetCallType(Isolate* isolate) const { 582 Call::CallType Call::GetCallType(Isolate* isolate) const {
577 VariableProxy* proxy = expression()->AsVariableProxy(); 583 VariableProxy* proxy = expression()->AsVariableProxy();
578 if (proxy != NULL) { 584 if (proxy != NULL) {
579 if (proxy->var()->is_possibly_eval(isolate)) { 585 if (proxy->var()->is_possibly_eval(isolate)) {
580 return POSSIBLY_EVAL_CALL; 586 return POSSIBLY_EVAL_CALL;
581 } else if (proxy->var()->IsUnallocated()) { 587 } else if (proxy->var()->IsUnallocated()) {
582 return GLOBAL_CALL; 588 return GLOBAL_CALL;
583 } else if (proxy->var()->IsLookupSlot()) { 589 } else if (proxy->var()->IsLookupSlot()) {
584 return LOOKUP_SLOT_CALL; 590 return LOOKUP_SLOT_CALL;
585 } 591 }
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 // static 1017 // static
1012 bool Literal::Match(void* literal1, void* literal2) { 1018 bool Literal::Match(void* literal1, void* literal2) {
1013 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 1019 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
1014 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 1020 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
1015 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || 1021 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) ||
1016 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 1022 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
1017 } 1023 }
1018 1024
1019 1025
1020 } } // namespace v8::internal 1026 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698