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.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 Loading... |
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 Loading... |
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 |
OLD | NEW |