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

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

Issue 148523011: Add dependency operand to HLoadNamedField. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix HLoadNamedField::PrintDataTo(). 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.cc » ('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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 GetParameter(1), 344 GetParameter(1),
345 static_cast<HValue*>(NULL), 345 static_cast<HValue*>(NULL),
346 FAST_ELEMENTS); 346 FAST_ELEMENTS);
347 IfBuilder checker(this); 347 IfBuilder checker(this);
348 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site, 348 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site,
349 undefined); 349 undefined);
350 checker.Then(); 350 checker.Then();
351 351
352 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset( 352 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
353 AllocationSite::kTransitionInfoOffset); 353 AllocationSite::kTransitionInfoOffset);
354 HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access); 354 HInstruction* boilerplate = Add<HLoadNamedField>(
355 allocation_site, static_cast<HValue*>(NULL), access);
355 HValue* push_value; 356 HValue* push_value;
356 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) { 357 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) {
357 HValue* elements = AddLoadElements(boilerplate); 358 HValue* elements = AddLoadElements(boilerplate);
358 359
359 IfBuilder if_fixed_cow(this); 360 IfBuilder if_fixed_cow(this);
360 if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map()); 361 if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map());
361 if_fixed_cow.Then(); 362 if_fixed_cow.Then();
362 push_value = BuildCloneShallowArray(boilerplate, 363 push_value = BuildCloneShallowArray(boilerplate,
363 allocation_site, 364 allocation_site,
364 alloc_site_mode, 365 alloc_site_mode,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 static_cast<HValue*>(NULL), 415 static_cast<HValue*>(NULL),
415 FAST_ELEMENTS); 416 FAST_ELEMENTS);
416 417
417 IfBuilder checker(this); 418 IfBuilder checker(this);
418 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site, 419 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site,
419 undefined); 420 undefined);
420 checker.And(); 421 checker.And();
421 422
422 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset( 423 HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
423 AllocationSite::kTransitionInfoOffset); 424 AllocationSite::kTransitionInfoOffset);
424 HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access); 425 HInstruction* boilerplate = Add<HLoadNamedField>(
426 allocation_site, static_cast<HValue*>(NULL), access);
425 427
426 int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize; 428 int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
427 int object_size = size; 429 int object_size = size;
428 if (FLAG_allocation_site_pretenuring) { 430 if (FLAG_allocation_site_pretenuring) {
429 size += AllocationMemento::kSize; 431 size += AllocationMemento::kSize;
430 } 432 }
431 433
432 HValue* boilerplate_map = Add<HLoadNamedField>( 434 HValue* boilerplate_map = Add<HLoadNamedField>(
433 boilerplate, HObjectAccess::ForMap()); 435 boilerplate, static_cast<HValue*>(NULL),
436 HObjectAccess::ForMap());
434 HValue* boilerplate_size = Add<HLoadNamedField>( 437 HValue* boilerplate_size = Add<HLoadNamedField>(
435 boilerplate_map, HObjectAccess::ForMapInstanceSize()); 438 boilerplate_map, static_cast<HValue*>(NULL),
439 HObjectAccess::ForMapInstanceSize());
436 HValue* size_in_words = Add<HConstant>(object_size >> kPointerSizeLog2); 440 HValue* size_in_words = Add<HConstant>(object_size >> kPointerSizeLog2);
437 checker.If<HCompareNumericAndBranch>(boilerplate_size, 441 checker.If<HCompareNumericAndBranch>(boilerplate_size,
438 size_in_words, Token::EQ); 442 size_in_words, Token::EQ);
439 checker.Then(); 443 checker.Then();
440 444
441 HValue* size_in_bytes = Add<HConstant>(size); 445 HValue* size_in_bytes = Add<HConstant>(size);
442 446
443 HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(), 447 HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(),
444 NOT_TENURED, JS_OBJECT_TYPE); 448 NOT_TENURED, JS_OBJECT_TYPE);
445 449
446 for (int i = 0; i < object_size; i += kPointerSize) { 450 for (int i = 0; i < object_size; i += kPointerSize) {
447 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i); 451 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i);
448 Add<HStoreNamedField>(object, access, 452 Add<HStoreNamedField>(
449 Add<HLoadNamedField>(boilerplate, access), 453 object, access, Add<HLoadNamedField>(
450 INITIALIZING_STORE); 454 boilerplate, static_cast<HValue*>(NULL), access),
455 INITIALIZING_STORE);
451 } 456 }
452 457
453 ASSERT(FLAG_allocation_site_pretenuring || (size == object_size)); 458 ASSERT(FLAG_allocation_site_pretenuring || (size == object_size));
454 if (FLAG_allocation_site_pretenuring) { 459 if (FLAG_allocation_site_pretenuring) {
455 BuildCreateAllocationMemento( 460 BuildCreateAllocationMemento(
456 object, Add<HConstant>(object_size), allocation_site); 461 object, Add<HConstant>(object_size), allocation_site);
457 } 462 }
458 463
459 environment()->Push(object); 464 environment()->Push(object);
460 checker.ElseDeopt("Uninitialized boilerplate in fast clone"); 465 checker.ElseDeopt("Uninitialized boilerplate in fast clone");
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 HStoreNamedField* store = Add<HStoreNamedField>( 519 HStoreNamedField* store = Add<HStoreNamedField>(
515 object, 520 object,
516 HObjectAccess::ForAllocationSiteOffset( 521 HObjectAccess::ForAllocationSiteOffset(
517 AllocationSite::kDependentCodeOffset), 522 AllocationSite::kDependentCodeOffset),
518 empty_fixed_array, 523 empty_fixed_array,
519 INITIALIZING_STORE); 524 INITIALIZING_STORE);
520 525
521 // Link the object to the allocation site list 526 // Link the object to the allocation site list
522 HValue* site_list = Add<HConstant>( 527 HValue* site_list = Add<HConstant>(
523 ExternalReference::allocation_sites_list_address(isolate())); 528 ExternalReference::allocation_sites_list_address(isolate()));
524 HValue* site = Add<HLoadNamedField>(site_list, 529 HValue* site = Add<HLoadNamedField>(
525 HObjectAccess::ForAllocationSiteList()); 530 site_list, static_cast<HValue*>(NULL),
531 HObjectAccess::ForAllocationSiteList());
526 store = Add<HStoreNamedField>(object, 532 store = Add<HStoreNamedField>(object,
527 HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset), 533 HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset),
528 site, INITIALIZING_STORE); 534 site, INITIALIZING_STORE);
529 store->SkipWriteBarrier(); 535 store->SkipWriteBarrier();
530 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(), 536 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
531 object, INITIALIZING_STORE); 537 object, INITIALIZING_STORE);
532 538
533 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input 539 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input
534 // cell is really a Cell, and so no write barrier is needed. 540 // cell is really a Cell, and so no write barrier is needed.
535 // TODO(mvstanton): Add a debug_code check to verify the input cell is really 541 // TODO(mvstanton): Add a debug_code check to verify the input cell is really
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 HParameter* receiver = GetParameter(0); 1068 HParameter* receiver = GetParameter(0);
1063 HParameter* value = GetParameter(2); 1069 HParameter* value = GetParameter(2);
1064 1070
1065 // Check that the map of the global has not changed: use a placeholder map 1071 // Check that the map of the global has not changed: use a placeholder map
1066 // that will be replaced later with the global object's map. 1072 // that will be replaced later with the global object's map.
1067 Handle<Map> placeholder_map = isolate()->factory()->meta_map(); 1073 Handle<Map> placeholder_map = isolate()->factory()->meta_map();
1068 Add<HCheckMaps>(receiver, placeholder_map, top_info()); 1074 Add<HCheckMaps>(receiver, placeholder_map, top_info());
1069 1075
1070 HValue* cell = Add<HConstant>(placeholder_cell); 1076 HValue* cell = Add<HConstant>(placeholder_cell);
1071 HObjectAccess access(HObjectAccess::ForCellPayload(isolate())); 1077 HObjectAccess access(HObjectAccess::ForCellPayload(isolate()));
1072 HValue* cell_contents = Add<HLoadNamedField>(cell, access); 1078 HValue* cell_contents = Add<HLoadNamedField>(
1079 cell, static_cast<HValue*>(NULL), access);
1073 1080
1074 if (stub->is_constant()) { 1081 if (stub->is_constant()) {
1075 IfBuilder builder(this); 1082 IfBuilder builder(this);
1076 builder.If<HCompareObjectEqAndBranch>(cell_contents, value); 1083 builder.If<HCompareObjectEqAndBranch>(cell_contents, value);
1077 builder.Then(); 1084 builder.Then();
1078 builder.ElseDeopt("Unexpected cell contents in constant global store"); 1085 builder.ElseDeopt("Unexpected cell contents in constant global store");
1079 builder.End(); 1086 builder.End();
1080 } else { 1087 } else {
1081 // Load the payload of the global parameter cell. A hole indicates that the 1088 // Load the payload of the global parameter cell. A hole indicates that the
1082 // property has been deleted and that the store must be handled by the 1089 // property has been deleted and that the store must be handled by the
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 HValue* code_object) { 1147 HValue* code_object) {
1141 Counters* counters = isolate()->counters(); 1148 Counters* counters = isolate()->counters();
1142 AddIncrementCounter(counters->fast_new_closure_install_optimized()); 1149 AddIncrementCounter(counters->fast_new_closure_install_optimized());
1143 1150
1144 // TODO(fschneider): Idea: store proper code pointers in the optimized code 1151 // TODO(fschneider): Idea: store proper code pointers in the optimized code
1145 // map and either unmangle them on marking or do nothing as the whole map is 1152 // map and either unmangle them on marking or do nothing as the whole map is
1146 // discarded on major GC anyway. 1153 // discarded on major GC anyway.
1147 Add<HStoreCodeEntry>(js_function, code_object); 1154 Add<HStoreCodeEntry>(js_function, code_object);
1148 1155
1149 // Now link a function into a list of optimized functions. 1156 // Now link a function into a list of optimized functions.
1150 HValue* optimized_functions_list = Add<HLoadNamedField>(native_context, 1157 HValue* optimized_functions_list = Add<HLoadNamedField>(
1158 native_context, static_cast<HValue*>(NULL),
1151 HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST)); 1159 HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST));
1152 Add<HStoreNamedField>(js_function, 1160 Add<HStoreNamedField>(js_function,
1153 HObjectAccess::ForNextFunctionLinkPointer(), 1161 HObjectAccess::ForNextFunctionLinkPointer(),
1154 optimized_functions_list, INITIALIZING_STORE); 1162 optimized_functions_list, INITIALIZING_STORE);
1155 1163
1156 // This store is the only one that should have a write barrier. 1164 // This store is the only one that should have a write barrier.
1157 Add<HStoreNamedField>(native_context, 1165 Add<HStoreNamedField>(native_context,
1158 HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST), 1166 HObjectAccess::ForContextSlot(Context::OPTIMIZED_FUNCTIONS_LIST),
1159 js_function, INITIALIZING_STORE); 1167 js_function, INITIALIZING_STORE);
1160 } 1168 }
1161 1169
1162 1170
1163 void CodeStubGraphBuilderBase::BuildInstallCode(HValue* js_function, 1171 void CodeStubGraphBuilderBase::BuildInstallCode(HValue* js_function,
1164 HValue* shared_info) { 1172 HValue* shared_info) {
1165 Add<HStoreNamedField>(js_function, 1173 Add<HStoreNamedField>(js_function,
1166 HObjectAccess::ForNextFunctionLinkPointer(), 1174 HObjectAccess::ForNextFunctionLinkPointer(),
1167 graph()->GetConstantUndefined(), 1175 graph()->GetConstantUndefined(),
1168 INITIALIZING_STORE); 1176 INITIALIZING_STORE);
1169 HValue* code_object = Add<HLoadNamedField>(shared_info, 1177 HValue* code_object = Add<HLoadNamedField>(
1170 HObjectAccess::ForCodeOffset()); 1178 shared_info, static_cast<HValue*>(NULL), HObjectAccess::ForCodeOffset());
1171 Add<HStoreCodeEntry>(js_function, code_object); 1179 Add<HStoreCodeEntry>(js_function, code_object);
1172 } 1180 }
1173 1181
1174 1182
1175 void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap( 1183 void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
1176 HValue* js_function, 1184 HValue* js_function,
1177 HValue* shared_info, 1185 HValue* shared_info,
1178 HValue* native_context) { 1186 HValue* native_context) {
1179 Counters* counters = isolate()->counters(); 1187 Counters* counters = isolate()->counters();
1180 IfBuilder is_optimized(this); 1188 IfBuilder is_optimized(this);
1181 HInstruction* optimized_map = Add<HLoadNamedField>(shared_info, 1189 HInstruction* optimized_map = Add<HLoadNamedField>(
1190 shared_info, static_cast<HValue*>(NULL),
1182 HObjectAccess::ForOptimizedCodeMap()); 1191 HObjectAccess::ForOptimizedCodeMap());
1183 HValue* null_constant = Add<HConstant>(0); 1192 HValue* null_constant = Add<HConstant>(0);
1184 is_optimized.If<HCompareObjectEqAndBranch>(optimized_map, null_constant); 1193 is_optimized.If<HCompareObjectEqAndBranch>(optimized_map, null_constant);
1185 is_optimized.Then(); 1194 is_optimized.Then();
1186 { 1195 {
1187 BuildInstallCode(js_function, shared_info); 1196 BuildInstallCode(js_function, shared_info);
1188 } 1197 }
1189 is_optimized.Else(); 1198 is_optimized.Else();
1190 { 1199 {
1191 AddIncrementCounter(counters->fast_new_closure_try_optimized()); 1200 AddIncrementCounter(counters->fast_new_closure_try_optimized());
1192 // optimized_map points to fixed array of 3-element entries 1201 // optimized_map points to fixed array of 3-element entries
1193 // (native context, optimized code, literals). 1202 // (native context, optimized code, literals).
1194 // Map must never be empty, so check the first elements. 1203 // Map must never be empty, so check the first elements.
1195 Label install_optimized; 1204 Label install_optimized;
1196 HValue* first_context_slot = Add<HLoadNamedField>(optimized_map, 1205 HValue* first_context_slot = Add<HLoadNamedField>(
1206 optimized_map, static_cast<HValue*>(NULL),
1197 HObjectAccess::ForFirstContextSlot()); 1207 HObjectAccess::ForFirstContextSlot());
1198 HValue* first_osr_ast_slot = Add<HLoadNamedField>(optimized_map, 1208 HValue* first_osr_ast_slot = Add<HLoadNamedField>(
1209 optimized_map, static_cast<HValue*>(NULL),
1199 HObjectAccess::ForFirstOsrAstIdSlot()); 1210 HObjectAccess::ForFirstOsrAstIdSlot());
1200 HValue* osr_ast_id_none = Add<HConstant>(BailoutId::None().ToInt()); 1211 HValue* osr_ast_id_none = Add<HConstant>(BailoutId::None().ToInt());
1201 IfBuilder already_in(this); 1212 IfBuilder already_in(this);
1202 already_in.If<HCompareObjectEqAndBranch>(native_context, 1213 already_in.If<HCompareObjectEqAndBranch>(native_context,
1203 first_context_slot); 1214 first_context_slot);
1204 already_in.AndIf<HCompareObjectEqAndBranch>(first_osr_ast_slot, 1215 already_in.AndIf<HCompareObjectEqAndBranch>(first_osr_ast_slot,
1205 osr_ast_id_none); 1216 osr_ast_id_none);
1206 already_in.Then(); 1217 already_in.Then();
1207 { 1218 {
1208 HValue* code_object = Add<HLoadNamedField>(optimized_map, 1219 HValue* code_object = Add<HLoadNamedField>(
1209 HObjectAccess::ForFirstCodeSlot()); 1220 optimized_map, static_cast<HValue*>(NULL),
1221 HObjectAccess::ForFirstCodeSlot());
1210 BuildInstallOptimizedCode(js_function, native_context, code_object); 1222 BuildInstallOptimizedCode(js_function, native_context, code_object);
1211 } 1223 }
1212 already_in.Else(); 1224 already_in.Else();
1213 { 1225 {
1214 HValue* shared_function_entry_length = 1226 HValue* shared_function_entry_length =
1215 Add<HConstant>(SharedFunctionInfo::kEntryLength); 1227 Add<HConstant>(SharedFunctionInfo::kEntryLength);
1216 LoopBuilder loop_builder(this, 1228 LoopBuilder loop_builder(this,
1217 context(), 1229 context(),
1218 LoopBuilder::kPostDecrement, 1230 LoopBuilder::kPostDecrement,
1219 shared_function_entry_length); 1231 shared_function_entry_length);
1220 HValue* array_length = Add<HLoadNamedField>(optimized_map, 1232 HValue* array_length = Add<HLoadNamedField>(
1233 optimized_map, static_cast<HValue*>(NULL),
1221 HObjectAccess::ForFixedArrayLength()); 1234 HObjectAccess::ForFixedArrayLength());
1222 HValue* slot_iterator = loop_builder.BeginBody(array_length, 1235 HValue* slot_iterator = loop_builder.BeginBody(array_length,
1223 graph()->GetConstant0(), 1236 graph()->GetConstant0(),
1224 Token::GT); 1237 Token::GT);
1225 { 1238 {
1226 // Iterate through the rest of map backwards. 1239 // Iterate through the rest of map backwards.
1227 // Do not double check first entry. 1240 // Do not double check first entry.
1228 HValue* second_entry_index = 1241 HValue* second_entry_index =
1229 Add<HConstant>(SharedFunctionInfo::kSecondEntryIndex); 1242 Add<HConstant>(SharedFunctionInfo::kSecondEntryIndex);
1230 IfBuilder restore_check(this); 1243 IfBuilder restore_check(this);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 HValue* size = Add<HConstant>(JSFunction::kSize); 1306 HValue* size = Add<HConstant>(JSFunction::kSize);
1294 HInstruction* js_function = Add<HAllocate>(size, HType::JSObject(), 1307 HInstruction* js_function = Add<HAllocate>(size, HType::JSObject(),
1295 NOT_TENURED, JS_FUNCTION_TYPE); 1308 NOT_TENURED, JS_FUNCTION_TYPE);
1296 1309
1297 int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(), 1310 int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(),
1298 casted_stub()->is_generator()); 1311 casted_stub()->is_generator());
1299 1312
1300 // Compute the function map in the current native context and set that 1313 // Compute the function map in the current native context and set that
1301 // as the map of the allocated object. 1314 // as the map of the allocated object.
1302 HInstruction* native_context = BuildGetNativeContext(); 1315 HInstruction* native_context = BuildGetNativeContext();
1303 HInstruction* map_slot_value = Add<HLoadNamedField>(native_context, 1316 HInstruction* map_slot_value = Add<HLoadNamedField>(
1317 native_context, static_cast<HValue*>(NULL),
1304 HObjectAccess::ForContextSlot(map_index)); 1318 HObjectAccess::ForContextSlot(map_index));
1305 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value, 1319 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value,
1306 INITIALIZING_STORE); 1320 INITIALIZING_STORE);
1307 1321
1308 // Initialize the rest of the function. 1322 // Initialize the rest of the function.
1309 Add<HStoreNamedField>(js_function, HObjectAccess::ForPropertiesPointer(), 1323 Add<HStoreNamedField>(js_function, HObjectAccess::ForPropertiesPointer(),
1310 empty_fixed_array, INITIALIZING_STORE); 1324 empty_fixed_array, INITIALIZING_STORE);
1311 Add<HStoreNamedField>(js_function, HObjectAccess::ForElementsPointer(), 1325 Add<HStoreNamedField>(js_function, HObjectAccess::ForElementsPointer(),
1312 empty_fixed_array, INITIALIZING_STORE); 1326 empty_fixed_array, INITIALIZING_STORE);
1313 Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(), 1327 Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(),
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 function, INITIALIZING_STORE); 1377 function, INITIALIZING_STORE);
1364 Add<HStoreNamedField>(function_context, 1378 Add<HStoreNamedField>(function_context,
1365 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX), 1379 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX),
1366 context(), INITIALIZING_STORE); 1380 context(), INITIALIZING_STORE);
1367 Add<HStoreNamedField>(function_context, 1381 Add<HStoreNamedField>(function_context,
1368 HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX), 1382 HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX),
1369 graph()->GetConstant0(), INITIALIZING_STORE); 1383 graph()->GetConstant0(), INITIALIZING_STORE);
1370 1384
1371 // Copy the global object from the previous context. 1385 // Copy the global object from the previous context.
1372 HValue* global_object = Add<HLoadNamedField>( 1386 HValue* global_object = Add<HLoadNamedField>(
1373 context(), HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); 1387 context(), static_cast<HValue*>(NULL),
1388 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
1374 Add<HStoreNamedField>(function_context, 1389 Add<HStoreNamedField>(function_context,
1375 HObjectAccess::ForContextSlot( 1390 HObjectAccess::ForContextSlot(
1376 Context::GLOBAL_OBJECT_INDEX), 1391 Context::GLOBAL_OBJECT_INDEX),
1377 global_object, 1392 global_object,
1378 INITIALIZING_STORE); 1393 INITIALIZING_STORE);
1379 1394
1380 // Initialize the rest of the slots to undefined. 1395 // Initialize the rest of the slots to undefined.
1381 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; ++i) { 1396 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; ++i) {
1382 Add<HStoreNamedField>(function_context, 1397 Add<HStoreNamedField>(function_context,
1383 HObjectAccess::ForContextSlot(i), 1398 HObjectAccess::ForContextSlot(i),
(...skipping 20 matching lines...) Expand all
1404 return BuildUncheckedDictionaryElementLoad(receiver, key); 1419 return BuildUncheckedDictionaryElementLoad(receiver, key);
1405 } 1420 }
1406 1421
1407 1422
1408 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) { 1423 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) {
1409 return DoGenerateCode(isolate, this); 1424 return DoGenerateCode(isolate, this);
1410 } 1425 }
1411 1426
1412 1427
1413 } } // namespace v8::internal 1428 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698