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

Side by Side Diff: src/ast.cc

Issue 661433002: Implement the new semantics for 'super(...)' (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 6 years, 2 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/ast-graph-builder.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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 if (proxy != NULL) { 574 if (proxy != NULL) {
575 if (proxy->var()->is_possibly_eval(isolate)) { 575 if (proxy->var()->is_possibly_eval(isolate)) {
576 return POSSIBLY_EVAL_CALL; 576 return POSSIBLY_EVAL_CALL;
577 } else if (proxy->var()->IsUnallocated()) { 577 } else if (proxy->var()->IsUnallocated()) {
578 return GLOBAL_CALL; 578 return GLOBAL_CALL;
579 } else if (proxy->var()->IsLookupSlot()) { 579 } else if (proxy->var()->IsLookupSlot()) {
580 return LOOKUP_SLOT_CALL; 580 return LOOKUP_SLOT_CALL;
581 } 581 }
582 } 582 }
583 583
584 if (expression()->AsSuperReference() != NULL) return SUPER_CALL;
585
584 Property* property = expression()->AsProperty(); 586 Property* property = expression()->AsProperty();
585 return property != NULL ? PROPERTY_CALL : OTHER_CALL; 587 return property != NULL ? PROPERTY_CALL : OTHER_CALL;
586 } 588 }
587 589
588 590
589 bool Call::ComputeGlobalTarget(Handle<GlobalObject> global, 591 bool Call::ComputeGlobalTarget(Handle<GlobalObject> global,
590 LookupIterator* it) { 592 LookupIterator* it) {
591 target_ = Handle<JSFunction>::null(); 593 target_ = Handle<JSFunction>::null();
592 cell_ = Handle<Cell>::null(); 594 cell_ = Handle<Cell>::null();
593 DCHECK(it->IsFound() && it->GetHolder<JSObject>().is_identical_to(global)); 595 DCHECK(it->IsFound() && it->GetHolder<JSObject>().is_identical_to(global));
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 // static 1145 // static
1144 bool Literal::Match(void* literal1, void* literal2) { 1146 bool Literal::Match(void* literal1, void* literal2) {
1145 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 1147 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
1146 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 1148 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
1147 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || 1149 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) ||
1148 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 1150 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
1149 } 1151 }
1150 1152
1151 1153
1152 } } // namespace v8::internal 1154 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698