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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 143413019: Load elimination fix with a test case. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review notes applied Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.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 // 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 checker.Then(); 439 checker.Then();
440 440
441 HValue* size_in_bytes = Add<HConstant>(size); 441 HValue* size_in_bytes = Add<HConstant>(size);
442 442
443 HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(), 443 HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(),
444 NOT_TENURED, JS_OBJECT_TYPE); 444 NOT_TENURED, JS_OBJECT_TYPE);
445 445
446 for (int i = 0; i < object_size; i += kPointerSize) { 446 for (int i = 0; i < object_size; i += kPointerSize) {
447 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i); 447 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i);
448 Add<HStoreNamedField>(object, access, 448 Add<HStoreNamedField>(object, access,
449 Add<HLoadNamedField>(boilerplate, access)); 449 Add<HLoadNamedField>(boilerplate, access),
450 INITIALIZING_STORE);
450 } 451 }
451 452
452 ASSERT(FLAG_allocation_site_pretenuring || (size == object_size)); 453 ASSERT(FLAG_allocation_site_pretenuring || (size == object_size));
453 if (FLAG_allocation_site_pretenuring) { 454 if (FLAG_allocation_site_pretenuring) {
454 BuildCreateAllocationMemento( 455 BuildCreateAllocationMemento(
455 object, Add<HConstant>(object_size), allocation_site); 456 object, Add<HConstant>(object_size), allocation_site);
456 } 457 }
457 458
458 environment()->Push(object); 459 environment()->Push(object);
459 checker.ElseDeopt("Uninitialized boilerplate in fast clone"); 460 checker.ElseDeopt("Uninitialized boilerplate in fast clone");
(...skipping 16 matching lines...) Expand all
476 477
477 // Store the map 478 // Store the map
478 Handle<Map> allocation_site_map = isolate()->factory()->allocation_site_map(); 479 Handle<Map> allocation_site_map = isolate()->factory()->allocation_site_map();
479 AddStoreMapConstant(object, allocation_site_map); 480 AddStoreMapConstant(object, allocation_site_map);
480 481
481 // Store the payload (smi elements kind) 482 // Store the payload (smi elements kind)
482 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); 483 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind());
483 Add<HStoreNamedField>(object, 484 Add<HStoreNamedField>(object,
484 HObjectAccess::ForAllocationSiteOffset( 485 HObjectAccess::ForAllocationSiteOffset(
485 AllocationSite::kTransitionInfoOffset), 486 AllocationSite::kTransitionInfoOffset),
486 initial_elements_kind); 487 initial_elements_kind,
488 INITIALIZING_STORE);
487 489
488 // Unlike literals, constructed arrays don't have nested sites 490 // Unlike literals, constructed arrays don't have nested sites
489 Add<HStoreNamedField>(object, 491 Add<HStoreNamedField>(object,
490 HObjectAccess::ForAllocationSiteOffset( 492 HObjectAccess::ForAllocationSiteOffset(
491 AllocationSite::kNestedSiteOffset), 493 AllocationSite::kNestedSiteOffset),
492 graph()->GetConstant0()); 494 graph()->GetConstant0(),
495 INITIALIZING_STORE);
493 496
494 // Pretenuring calculation field. 497 // Pretenuring calculation field.
495 Add<HStoreNamedField>(object, 498 Add<HStoreNamedField>(object,
496 HObjectAccess::ForAllocationSiteOffset( 499 HObjectAccess::ForAllocationSiteOffset(
497 AllocationSite::kPretenureDataOffset), 500 AllocationSite::kPretenureDataOffset),
498 graph()->GetConstant0()); 501 graph()->GetConstant0(),
502 INITIALIZING_STORE);
499 503
500 // Pretenuring memento creation count field. 504 // Pretenuring memento creation count field.
501 Add<HStoreNamedField>(object, 505 Add<HStoreNamedField>(object,
502 HObjectAccess::ForAllocationSiteOffset( 506 HObjectAccess::ForAllocationSiteOffset(
503 AllocationSite::kPretenureCreateCountOffset), 507 AllocationSite::kPretenureCreateCountOffset),
504 graph()->GetConstant0()); 508 graph()->GetConstant0(),
509 INITIALIZING_STORE);
505 510
506 // Store an empty fixed array for the code dependency. 511 // Store an empty fixed array for the code dependency.
507 HConstant* empty_fixed_array = 512 HConstant* empty_fixed_array =
508 Add<HConstant>(isolate()->factory()->empty_fixed_array()); 513 Add<HConstant>(isolate()->factory()->empty_fixed_array());
509 HStoreNamedField* store = Add<HStoreNamedField>( 514 HStoreNamedField* store = Add<HStoreNamedField>(
510 object, 515 object,
511 HObjectAccess::ForAllocationSiteOffset( 516 HObjectAccess::ForAllocationSiteOffset(
512 AllocationSite::kDependentCodeOffset), 517 AllocationSite::kDependentCodeOffset),
513 empty_fixed_array); 518 empty_fixed_array,
519 INITIALIZING_STORE);
514 520
515 // Link the object to the allocation site list 521 // Link the object to the allocation site list
516 HValue* site_list = Add<HConstant>( 522 HValue* site_list = Add<HConstant>(
517 ExternalReference::allocation_sites_list_address(isolate())); 523 ExternalReference::allocation_sites_list_address(isolate()));
518 HValue* site = Add<HLoadNamedField>(site_list, 524 HValue* site = Add<HLoadNamedField>(site_list,
519 HObjectAccess::ForAllocationSiteList()); 525 HObjectAccess::ForAllocationSiteList());
520 store = Add<HStoreNamedField>(object, 526 store = Add<HStoreNamedField>(object,
521 HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset), 527 HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset),
522 site); 528 site, INITIALIZING_STORE);
523 store->SkipWriteBarrier(); 529 store->SkipWriteBarrier();
524 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(), 530 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
525 object); 531 object, INITIALIZING_STORE);
526 532
527 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input 533 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input
528 // cell is really a Cell, and so no write barrier is needed. 534 // cell is really a Cell, and so no write barrier is needed.
529 // TODO(mvstanton): Add a debug_code check to verify the input cell is really 535 // TODO(mvstanton): Add a debug_code check to verify the input cell is really
530 // a cell. (perhaps with a new instruction, HAssert). 536 // a cell. (perhaps with a new instruction, HAssert).
531 HInstruction* cell = GetParameter(0); 537 HInstruction* cell = GetParameter(0);
532 HObjectAccess access = HObjectAccess::ForCellValue(); 538 HObjectAccess access = HObjectAccess::ForCellValue();
533 store = Add<HStoreNamedField>(cell, access, object); 539 store = Add<HStoreNamedField>(cell, access, object, INITIALIZING_STORE);
534 store->SkipWriteBarrier(); 540 store->SkipWriteBarrier();
535 return cell; 541 return cell;
536 } 542 }
537 543
538 544
539 Handle<Code> CreateAllocationSiteStub::GenerateCode(Isolate* isolate) { 545 Handle<Code> CreateAllocationSiteStub::GenerateCode(Isolate* isolate) {
540 return DoGenerateCode(isolate, this); 546 return DoGenerateCode(isolate, this);
541 } 547 }
542 548
543 549
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 // Now populate the elements correctly. 745 // Now populate the elements correctly.
740 LoopBuilder builder(this, 746 LoopBuilder builder(this,
741 context(), 747 context(),
742 LoopBuilder::kPostIncrement); 748 LoopBuilder::kPostIncrement);
743 HValue* start = graph()->GetConstant0(); 749 HValue* start = graph()->GetConstant0();
744 HValue* key = builder.BeginBody(start, checked_length, Token::LT); 750 HValue* key = builder.BeginBody(start, checked_length, Token::LT);
745 HInstruction* argument_elements = Add<HArgumentsElements>(false); 751 HInstruction* argument_elements = Add<HArgumentsElements>(false);
746 HInstruction* argument = Add<HAccessArgumentsAt>( 752 HInstruction* argument = Add<HAccessArgumentsAt>(
747 argument_elements, checked_length, key); 753 argument_elements, checked_length, key);
748 754
749 Add<HStoreKeyed>(elements, key, argument, kind); 755 Add<HStoreKeyed>(elements, key, argument, kind, INITIALIZING_STORE);
750 builder.EndBody(); 756 builder.EndBody();
751 return new_object; 757 return new_object;
752 } 758 }
753 759
754 760
755 template <> 761 template <>
756 HValue* CodeStubGraphBuilder<ArrayNoArgumentConstructorStub>::BuildCodeStub() { 762 HValue* CodeStubGraphBuilder<ArrayNoArgumentConstructorStub>::BuildCodeStub() {
757 ElementsKind kind = casted_stub()->elements_kind(); 763 ElementsKind kind = casted_stub()->elements_kind();
758 AllocationSiteOverrideMode override_mode = casted_stub()->override_mode(); 764 AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
759 return BuildArrayConstructor(kind, override_mode, NONE); 765 return BuildArrayConstructor(kind, override_mode, NONE);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 result = EnforceNumberType(result, result_type); 956 result = EnforceNumberType(result, result_type);
951 } 957 }
952 958
953 // Reuse the double box of one of the operands if we are allowed to (i.e. 959 // Reuse the double box of one of the operands if we are allowed to (i.e.
954 // chained binops). 960 // chained binops).
955 if (state.CanReuseDoubleBox()) { 961 if (state.CanReuseDoubleBox()) {
956 HValue* operand = (state.mode() == OVERWRITE_LEFT) ? left : right; 962 HValue* operand = (state.mode() == OVERWRITE_LEFT) ? left : right;
957 IfBuilder if_heap_number(this); 963 IfBuilder if_heap_number(this);
958 if_heap_number.IfNot<HIsSmiAndBranch>(operand); 964 if_heap_number.IfNot<HIsSmiAndBranch>(operand);
959 if_heap_number.Then(); 965 if_heap_number.Then();
960 Add<HStoreNamedField>(operand, HObjectAccess::ForHeapNumberValue(), result); 966 Add<HStoreNamedField>(operand, HObjectAccess::ForHeapNumberValue(), result,
967 INITIALIZING_STORE);
961 Push(operand); 968 Push(operand);
962 if_heap_number.Else(); 969 if_heap_number.Else();
963 Push(result); 970 Push(result);
964 if_heap_number.End(); 971 if_heap_number.End();
965 result = Pop(); 972 result = Pop();
966 } 973 }
967 974
968 return result; 975 return result;
969 } 976 }
970 977
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 } else { 1080 } else {
1074 // Load the payload of the global parameter cell. A hole indicates that the 1081 // Load the payload of the global parameter cell. A hole indicates that the
1075 // property has been deleted and that the store must be handled by the 1082 // property has been deleted and that the store must be handled by the
1076 // runtime. 1083 // runtime.
1077 IfBuilder builder(this); 1084 IfBuilder builder(this);
1078 HValue* hole_value = Add<HConstant>(hole); 1085 HValue* hole_value = Add<HConstant>(hole);
1079 builder.If<HCompareObjectEqAndBranch>(cell_contents, hole_value); 1086 builder.If<HCompareObjectEqAndBranch>(cell_contents, hole_value);
1080 builder.Then(); 1087 builder.Then();
1081 builder.Deopt("Unexpected cell contents in global store"); 1088 builder.Deopt("Unexpected cell contents in global store");
1082 builder.Else(); 1089 builder.Else();
1083 Add<HStoreNamedField>(cell, access, value); 1090 Add<HStoreNamedField>(cell, access, value, INITIALIZING_STORE);
1084 builder.End(); 1091 builder.End();
1085 } 1092 }
1086 1093
1087 return value; 1094 return value;
1088 } 1095 }
1089 1096
1090 1097
1091 Handle<Code> StoreGlobalStub::GenerateCode(Isolate* isolate) { 1098 Handle<Code> StoreGlobalStub::GenerateCode(Isolate* isolate) {
1092 return DoGenerateCode(isolate, this); 1099 return DoGenerateCode(isolate, this);
1093 } 1100 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 // TODO(fschneider): Idea: store proper code pointers in the optimized code 1144 // TODO(fschneider): Idea: store proper code pointers in the optimized code
1138 // map and either unmangle them on marking or do nothing as the whole map is 1145 // map and either unmangle them on marking or do nothing as the whole map is
1139 // discarded on major GC anyway. 1146 // discarded on major GC anyway.
1140 Add<HStoreCodeEntry>(js_function, code_object); 1147 Add<HStoreCodeEntry>(js_function, code_object);
1141 1148
1142 // Now link a function into a list of optimized functions. 1149 // Now link a function into a list of optimized functions.
1143 HValue* optimized_functions_list = Add<HLoadNamedField>(native_context, 1150 HValue* optimized_functions_list = Add<HLoadNamedField>(native_context,
1144 HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST)); 1151 HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST));
1145 Add<HStoreNamedField>(js_function, 1152 Add<HStoreNamedField>(js_function,
1146 HObjectAccess::ForNextFunctionLinkPointer(), 1153 HObjectAccess::ForNextFunctionLinkPointer(),
1147 optimized_functions_list); 1154 optimized_functions_list, INITIALIZING_STORE);
1148 1155
1149 // This store is the only one that should have a write barrier. 1156 // This store is the only one that should have a write barrier.
1150 Add<HStoreNamedField>(native_context, 1157 Add<HStoreNamedField>(native_context,
1151 HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST), 1158 HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST),
1152 js_function); 1159 js_function, INITIALIZING_STORE);
1153 } 1160 }
1154 1161
1155 1162
1156 void CodeStubGraphBuilderBase::BuildInstallCode(HValue* js_function, 1163 void CodeStubGraphBuilderBase::BuildInstallCode(HValue* js_function,
1157 HValue* shared_info) { 1164 HValue* shared_info) {
1158 Add<HStoreNamedField>(js_function, 1165 Add<HStoreNamedField>(js_function,
1159 HObjectAccess::ForNextFunctionLinkPointer(), 1166 HObjectAccess::ForNextFunctionLinkPointer(),
1160 graph()->GetConstantUndefined()); 1167 graph()->GetConstantUndefined(),
1168 INITIALIZING_STORE);
1161 HValue* code_object = Add<HLoadNamedField>(shared_info, 1169 HValue* code_object = Add<HLoadNamedField>(shared_info,
1162 HObjectAccess::ForCodeOffset()); 1170 HObjectAccess::ForCodeOffset());
1163 Add<HStoreCodeEntry>(js_function, code_object); 1171 Add<HStoreCodeEntry>(js_function, code_object);
1164 } 1172 }
1165 1173
1166 1174
1167 void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap( 1175 void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
1168 HValue* js_function, 1176 HValue* js_function,
1169 HValue* shared_info, 1177 HValue* shared_info,
1170 HValue* native_context) { 1178 HValue* native_context) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 NOT_TENURED, JS_FUNCTION_TYPE); 1295 NOT_TENURED, JS_FUNCTION_TYPE);
1288 1296
1289 int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(), 1297 int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(),
1290 casted_stub()->is_generator()); 1298 casted_stub()->is_generator());
1291 1299
1292 // Compute the function map in the current native context and set that 1300 // Compute the function map in the current native context and set that
1293 // as the map of the allocated object. 1301 // as the map of the allocated object.
1294 HInstruction* native_context = BuildGetNativeContext(); 1302 HInstruction* native_context = BuildGetNativeContext();
1295 HInstruction* map_slot_value = Add<HLoadNamedField>(native_context, 1303 HInstruction* map_slot_value = Add<HLoadNamedField>(native_context,
1296 HObjectAccess::ForContextSlot(map_index)); 1304 HObjectAccess::ForContextSlot(map_index));
1297 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value); 1305 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value,
1306 INITIALIZING_STORE);
1298 1307
1299 // Initialize the rest of the function. 1308 // Initialize the rest of the function.
1300 Add<HStoreNamedField>(js_function, HObjectAccess::ForPropertiesPointer(), 1309 Add<HStoreNamedField>(js_function, HObjectAccess::ForPropertiesPointer(),
1301 empty_fixed_array); 1310 empty_fixed_array, INITIALIZING_STORE);
1302 Add<HStoreNamedField>(js_function, HObjectAccess::ForElementsPointer(), 1311 Add<HStoreNamedField>(js_function, HObjectAccess::ForElementsPointer(),
1303 empty_fixed_array); 1312 empty_fixed_array, INITIALIZING_STORE);
1304 Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(), 1313 Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(),
1305 empty_fixed_array); 1314 empty_fixed_array, INITIALIZING_STORE);
1306 Add<HStoreNamedField>(js_function, HObjectAccess::ForPrototypeOrInitialMap(), 1315 Add<HStoreNamedField>(js_function, HObjectAccess::ForPrototypeOrInitialMap(),
1307 graph()->GetConstantHole()); 1316 graph()->GetConstantHole(), INITIALIZING_STORE);
1308 Add<HStoreNamedField>(js_function, 1317 Add<HStoreNamedField>(js_function,
1309 HObjectAccess::ForSharedFunctionInfoPointer(), 1318 HObjectAccess::ForSharedFunctionInfoPointer(),
1310 shared_info); 1319 shared_info, INITIALIZING_STORE);
1311 Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(), 1320 Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
1312 context()); 1321 context(), INITIALIZING_STORE);
1313 1322
1314 // Initialize the code pointer in the function to be the one 1323 // Initialize the code pointer in the function to be the one
1315 // found in the shared function info object. 1324 // found in the shared function info object.
1316 // But first check if there is an optimized version for our context. 1325 // But first check if there is an optimized version for our context.
1317 if (FLAG_cache_optimized_code) { 1326 if (FLAG_cache_optimized_code) {
1318 BuildInstallFromOptimizedCodeMap(js_function, shared_info, native_context); 1327 BuildInstallFromOptimizedCodeMap(js_function, shared_info, native_context);
1319 } else { 1328 } else {
1320 BuildInstallCode(js_function, shared_info); 1329 BuildInstallCode(js_function, shared_info);
1321 } 1330 }
1322 1331
(...skipping 16 matching lines...) Expand all
1339 // Allocate the context in new space. 1348 // Allocate the context in new space.
1340 HAllocate* function_context = Add<HAllocate>( 1349 HAllocate* function_context = Add<HAllocate>(
1341 Add<HConstant>(length * kPointerSize + FixedArray::kHeaderSize), 1350 Add<HConstant>(length * kPointerSize + FixedArray::kHeaderSize),
1342 HType::Tagged(), NOT_TENURED, FIXED_ARRAY_TYPE); 1351 HType::Tagged(), NOT_TENURED, FIXED_ARRAY_TYPE);
1343 1352
1344 // Set up the object header. 1353 // Set up the object header.
1345 AddStoreMapConstant(function_context, 1354 AddStoreMapConstant(function_context,
1346 isolate()->factory()->function_context_map()); 1355 isolate()->factory()->function_context_map());
1347 Add<HStoreNamedField>(function_context, 1356 Add<HStoreNamedField>(function_context,
1348 HObjectAccess::ForFixedArrayLength(), 1357 HObjectAccess::ForFixedArrayLength(),
1349 Add<HConstant>(length)); 1358 Add<HConstant>(length), INITIALIZING_STORE);
1350 1359
1351 // Set up the fixed slots. 1360 // Set up the fixed slots.
1352 Add<HStoreNamedField>(function_context, 1361 Add<HStoreNamedField>(function_context,
1353 HObjectAccess::ForContextSlot(Context::CLOSURE_INDEX), 1362 HObjectAccess::ForContextSlot(Context::CLOSURE_INDEX),
1354 function); 1363 function, INITIALIZING_STORE);
1355 Add<HStoreNamedField>(function_context, 1364 Add<HStoreNamedField>(function_context,
1356 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX), 1365 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX),
1357 context()); 1366 context(), INITIALIZING_STORE);
1358 Add<HStoreNamedField>(function_context, 1367 Add<HStoreNamedField>(function_context,
1359 HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX), 1368 HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX),
1360 graph()->GetConstant0()); 1369 graph()->GetConstant0(), INITIALIZING_STORE);
1361 1370
1362 // Copy the global object from the previous context. 1371 // Copy the global object from the previous context.
1363 HValue* global_object = Add<HLoadNamedField>( 1372 HValue* global_object = Add<HLoadNamedField>(
1364 context(), HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); 1373 context(), HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
1365 Add<HStoreNamedField>(function_context, 1374 Add<HStoreNamedField>(function_context,
1366 HObjectAccess::ForContextSlot( 1375 HObjectAccess::ForContextSlot(
1367 Context::GLOBAL_OBJECT_INDEX), 1376 Context::GLOBAL_OBJECT_INDEX),
1368 global_object); 1377 global_object,
1378 INITIALIZING_STORE);
1369 1379
1370 // Initialize the rest of the slots to undefined. 1380 // Initialize the rest of the slots to undefined.
1371 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; ++i) { 1381 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; ++i) {
1372 Add<HStoreNamedField>(function_context, 1382 Add<HStoreNamedField>(function_context,
1373 HObjectAccess::ForContextSlot(i), 1383 HObjectAccess::ForContextSlot(i),
1374 graph()->GetConstantUndefined()); 1384 graph()->GetConstantUndefined(),
1385 INITIALIZING_STORE);
1375 } 1386 }
1376 1387
1377 return function_context; 1388 return function_context;
1378 } 1389 }
1379 1390
1380 1391
1381 Handle<Code> FastNewContextStub::GenerateCode(Isolate* isolate) { 1392 Handle<Code> FastNewContextStub::GenerateCode(Isolate* isolate) {
1382 return DoGenerateCode(isolate, this); 1393 return DoGenerateCode(isolate, this);
1383 } 1394 }
1384 1395
1385 1396
1386 template<> 1397 template<>
1387 HValue* CodeStubGraphBuilder<KeyedLoadDictionaryElementStub>::BuildCodeStub() { 1398 HValue* CodeStubGraphBuilder<KeyedLoadDictionaryElementStub>::BuildCodeStub() {
1388 HValue* receiver = GetParameter(0); 1399 HValue* receiver = GetParameter(0);
1389 HValue* key = GetParameter(1); 1400 HValue* key = GetParameter(1);
1390 1401
1391 Add<HCheckSmi>(key); 1402 Add<HCheckSmi>(key);
1392 1403
1393 return BuildUncheckedDictionaryElementLoad(receiver, key); 1404 return BuildUncheckedDictionaryElementLoad(receiver, key);
1394 } 1405 }
1395 1406
1396 1407
1397 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) { 1408 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) {
1398 return DoGenerateCode(isolate, this); 1409 return DoGenerateCode(isolate, this);
1399 } 1410 }
1400 1411
1401 1412
1402 } } // namespace v8::internal 1413 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698