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

Side by Side Diff: src/ast.cc

Issue 924123002: ES6 Classes: Remove tracking of super construct calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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.h ('k') | src/objects.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.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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return scope()->language_mode(); 145 return scope()->language_mode();
146 } 146 }
147 147
148 148
149 bool FunctionLiteral::uses_super_property() const { 149 bool FunctionLiteral::uses_super_property() const {
150 DCHECK_NOT_NULL(scope()); 150 DCHECK_NOT_NULL(scope());
151 return scope()->uses_super_property() || scope()->inner_uses_super_property(); 151 return scope()->uses_super_property() || scope()->inner_uses_super_property();
152 } 152 }
153 153
154 154
155 bool FunctionLiteral::uses_super_constructor_call() const {
156 DCHECK_NOT_NULL(scope());
157 return scope()->uses_super_constructor_call() ||
158 scope()->inner_uses_super_constructor_call();
159 }
160
161
162 // Helper to find an existing shared function info in the baseline code for the 155 // Helper to find an existing shared function info in the baseline code for the
163 // given function literal. Used to canonicalize SharedFunctionInfo objects. 156 // given function literal. Used to canonicalize SharedFunctionInfo objects.
164 void FunctionLiteral::InitializeSharedInfo( 157 void FunctionLiteral::InitializeSharedInfo(
165 Handle<Code> unoptimized_code) { 158 Handle<Code> unoptimized_code) {
166 for (RelocIterator it(*unoptimized_code); !it.done(); it.next()) { 159 for (RelocIterator it(*unoptimized_code); !it.done(); it.next()) {
167 RelocInfo* rinfo = it.rinfo(); 160 RelocInfo* rinfo = it.rinfo();
168 if (rinfo->rmode() != RelocInfo::EMBEDDED_OBJECT) continue; 161 if (rinfo->rmode() != RelocInfo::EMBEDDED_OBJECT) continue;
169 Object* obj = rinfo->target_object(); 162 Object* obj = rinfo->target_object();
170 if (obj->IsSharedFunctionInfo()) { 163 if (obj->IsSharedFunctionInfo()) {
171 SharedFunctionInfo* shared = SharedFunctionInfo::cast(obj); 164 SharedFunctionInfo* shared = SharedFunctionInfo::cast(obj);
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 // static 1012 // static
1020 bool Literal::Match(void* literal1, void* literal2) { 1013 bool Literal::Match(void* literal1, void* literal2) {
1021 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 1014 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
1022 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 1015 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
1023 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || 1016 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) ||
1024 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 1017 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
1025 } 1018 }
1026 1019
1027 1020
1028 } } // namespace v8::internal 1021 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698