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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 return code; | 1186 return code; |
1187 } | 1187 } |
1188 | 1188 |
1189 | 1189 |
1190 void ElementHandlerCompiler::GenerateStoreDictionaryElement( | 1190 void ElementHandlerCompiler::GenerateStoreDictionaryElement( |
1191 MacroAssembler* masm) { | 1191 MacroAssembler* masm) { |
1192 KeyedStoreIC::GenerateSlow(masm); | 1192 KeyedStoreIC::GenerateSlow(masm); |
1193 } | 1193 } |
1194 | 1194 |
1195 | 1195 |
1196 CallOptimization::CallOptimization(LookupResult* lookup) { | |
1197 if (lookup->IsFound() && | |
1198 lookup->IsCacheable() && | |
1199 lookup->IsConstantFunction()) { | |
1200 // We only optimize constant function calls. | |
1201 Initialize(Handle<JSFunction>(lookup->GetConstantFunction())); | |
1202 } else { | |
1203 Initialize(Handle<JSFunction>::null()); | |
1204 } | |
1205 } | |
1206 | |
1207 | |
1208 CallOptimization::CallOptimization(Handle<JSFunction> function) { | 1196 CallOptimization::CallOptimization(Handle<JSFunction> function) { |
1209 Initialize(function); | 1197 Initialize(function); |
1210 } | 1198 } |
1211 | 1199 |
1212 | 1200 |
1213 Handle<JSObject> CallOptimization::LookupHolderOfExpectedType( | 1201 Handle<JSObject> CallOptimization::LookupHolderOfExpectedType( |
1214 Handle<Map> object_map, | 1202 Handle<Map> object_map, |
1215 HolderLookup* holder_lookup) const { | 1203 HolderLookup* holder_lookup) const { |
1216 DCHECK(is_simple_api_call()); | 1204 DCHECK(is_simple_api_call()); |
1217 if (!object_map->IsJSObjectMap()) { | 1205 if (!object_map->IsJSObjectMap()) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 Handle<FunctionTemplateInfo>( | 1291 Handle<FunctionTemplateInfo>( |
1304 FunctionTemplateInfo::cast(signature->receiver())); | 1292 FunctionTemplateInfo::cast(signature->receiver())); |
1305 } | 1293 } |
1306 } | 1294 } |
1307 | 1295 |
1308 is_simple_api_call_ = true; | 1296 is_simple_api_call_ = true; |
1309 } | 1297 } |
1310 | 1298 |
1311 | 1299 |
1312 } } // namespace v8::internal | 1300 } } // namespace v8::internal |
OLD | NEW |