OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 is_optimized.End(); | 1254 is_optimized.End(); |
1255 } | 1255 } |
1256 | 1256 |
1257 | 1257 |
1258 template<> | 1258 template<> |
1259 HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() { | 1259 HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() { |
1260 Counters* counters = isolate()->counters(); | 1260 Counters* counters = isolate()->counters(); |
1261 Factory* factory = isolate()->factory(); | 1261 Factory* factory = isolate()->factory(); |
1262 HInstruction* empty_fixed_array = | 1262 HInstruction* empty_fixed_array = |
1263 Add<HConstant>(factory->empty_fixed_array()); | 1263 Add<HConstant>(factory->empty_fixed_array()); |
| 1264 HInstruction* empty_constant_pool_array = |
| 1265 Add<HConstant>(factory->empty_constant_pool_array()); |
1264 HValue* shared_info = GetParameter(0); | 1266 HValue* shared_info = GetParameter(0); |
1265 | 1267 |
1266 AddIncrementCounter(counters->fast_new_closure_total()); | 1268 AddIncrementCounter(counters->fast_new_closure_total()); |
1267 | 1269 |
1268 // Create a new closure from the given function info in new space | 1270 // Create a new closure from the given function info in new space |
1269 HValue* size = Add<HConstant>(JSFunction::kSize); | 1271 HValue* size = Add<HConstant>(JSFunction::kSize); |
1270 HInstruction* js_function = Add<HAllocate>(size, HType::JSObject(), | 1272 HInstruction* js_function = Add<HAllocate>(size, HType::JSObject(), |
1271 NOT_TENURED, JS_FUNCTION_TYPE); | 1273 NOT_TENURED, JS_FUNCTION_TYPE); |
1272 | 1274 |
1273 int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(), | 1275 int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(), |
(...skipping 13 matching lines...) Expand all Loading... |
1287 empty_fixed_array); | 1289 empty_fixed_array); |
1288 Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(), | 1290 Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(), |
1289 empty_fixed_array); | 1291 empty_fixed_array); |
1290 Add<HStoreNamedField>(js_function, HObjectAccess::ForPrototypeOrInitialMap(), | 1292 Add<HStoreNamedField>(js_function, HObjectAccess::ForPrototypeOrInitialMap(), |
1291 graph()->GetConstantHole()); | 1293 graph()->GetConstantHole()); |
1292 Add<HStoreNamedField>(js_function, | 1294 Add<HStoreNamedField>(js_function, |
1293 HObjectAccess::ForSharedFunctionInfoPointer(), | 1295 HObjectAccess::ForSharedFunctionInfoPointer(), |
1294 shared_info); | 1296 shared_info); |
1295 Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(), | 1297 Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(), |
1296 context()); | 1298 context()); |
| 1299 Add<HStoreNamedField>(js_function, |
| 1300 HObjectAccess::ForFunctionConstantPoolPointer(), |
| 1301 empty_constant_pool_array); |
1297 | 1302 |
1298 // Initialize the code pointer in the function to be the one | 1303 // Initialize the code pointer in the function to be the one |
1299 // found in the shared function info object. | 1304 // found in the shared function info object. |
1300 // But first check if there is an optimized version for our context. | 1305 // But first check if there is an optimized version for our context. |
1301 if (FLAG_cache_optimized_code) { | 1306 if (FLAG_cache_optimized_code) { |
1302 BuildInstallFromOptimizedCodeMap(js_function, shared_info, native_context); | 1307 BuildInstallFromOptimizedCodeMap(js_function, shared_info, native_context); |
1303 } else { | 1308 } else { |
1304 BuildInstallCode(js_function, shared_info); | 1309 BuildInstallCode(js_function, shared_info); |
1305 } | 1310 } |
1306 | 1311 |
(...skipping 16 matching lines...) Expand all Loading... |
1323 return BuildUncheckedDictionaryElementLoad(receiver, key); | 1328 return BuildUncheckedDictionaryElementLoad(receiver, key); |
1324 } | 1329 } |
1325 | 1330 |
1326 | 1331 |
1327 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) { | 1332 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) { |
1328 return DoGenerateCode(isolate, this); | 1333 return DoGenerateCode(isolate, this); |
1329 } | 1334 } |
1330 | 1335 |
1331 | 1336 |
1332 } } // namespace v8::internal | 1337 } } // namespace v8::internal |
OLD | NEW |