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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 19723004: Prefill pre-allocated memory of folded allocation with one pointer fillers when heap verifier is on. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.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 3219 matching lines...) Expand 10 before | Expand all | Expand 10 after
3230 int32_t current_size_constant = 3230 int32_t current_size_constant =
3231 HConstant::cast(current_size)->GetInteger32Constant(); 3231 HConstant::cast(current_size)->GetInteger32Constant();
3232 HBasicBlock* block = dominator->block(); 3232 HBasicBlock* block = dominator->block();
3233 Zone* zone = block->zone(); 3233 Zone* zone = block->zone();
3234 HInstruction* new_dominator_size = new(zone) HConstant( 3234 HInstruction* new_dominator_size = new(zone) HConstant(
3235 dominator_size_constant + current_size_constant); 3235 dominator_size_constant + current_size_constant);
3236 new_dominator_size->InsertBefore(dominator_allocate_instr); 3236 new_dominator_size->InsertBefore(dominator_allocate_instr);
3237 dominator_allocate_instr->UpdateSize(new_dominator_size); 3237 dominator_allocate_instr->UpdateSize(new_dominator_size);
3238 3238
3239 #ifdef VERIFY_HEAP 3239 #ifdef VERIFY_HEAP
3240 HInstruction* free_space_instr = 3240 if (FLAG_verify_heap) {
3241 new(zone) HInnerAllocatedObject(dominator_allocate_instr, 3241 dominator_allocate_instr->SetFlags(HAllocate::PREFILL_WITH_FILLER);
3242 dominator_size_constant, 3242 }
3243 type());
3244 free_space_instr->InsertAfter(dominator_allocate_instr);
3245 HConstant* filler_map = new(zone) HConstant(
3246 isolate()->factory()->free_space_map(),
3247 UniqueValueId(isolate()->heap()->free_space_map()),
3248 Representation::Tagged(),
3249 HType::Tagged(),
3250 false,
3251 true,
3252 false,
3253 false);
3254 filler_map->InsertAfter(free_space_instr);
3255
3256 HInstruction* store_map = new(zone) HStoreNamedField(
3257 free_space_instr, HObjectAccess::ForMap(), filler_map);
3258 store_map->SetFlag(HValue::kHasNoObservableSideEffects);
3259 store_map->InsertAfter(filler_map);
3260
3261 HInstruction* free_space_size = new(zone) HConstant(current_size_constant);
3262 free_space_size->InsertAfter(store_map);
3263 HObjectAccess access =
3264 HObjectAccess::ForJSObjectOffset(FreeSpace::kSizeOffset);
3265 HInstruction* store_size = new(zone) HStoreNamedField(
3266 free_space_instr, access, free_space_size);
3267 store_size->SetFlag(HValue::kHasNoObservableSideEffects);
3268 store_size->InsertAfter(free_space_size);
3269 #endif 3243 #endif
3270 3244
3271 // After that replace the dominated allocate instruction. 3245 // After that replace the dominated allocate instruction.
3272 HInstruction* dominated_allocate_instr = 3246 HInstruction* dominated_allocate_instr =
3273 new(zone) HInnerAllocatedObject(dominator_allocate_instr, 3247 new(zone) HInnerAllocatedObject(dominator_allocate_instr,
3274 dominator_size_constant, 3248 dominator_size_constant,
3275 type()); 3249 type());
3276 dominated_allocate_instr->InsertBefore(this); 3250 dominated_allocate_instr->InsertBefore(this);
3277 DeleteAndReplaceWith(dominated_allocate_instr); 3251 DeleteAndReplaceWith(dominated_allocate_instr);
3278 if (FLAG_trace_allocation_folding) { 3252 if (FLAG_trace_allocation_folding) {
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
3994 case kBackingStore: 3968 case kBackingStore:
3995 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); 3969 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString());
3996 stream->Add("[backing-store]"); 3970 stream->Add("[backing-store]");
3997 break; 3971 break;
3998 } 3972 }
3999 3973
4000 stream->Add("@%d", offset()); 3974 stream->Add("@%d", offset());
4001 } 3975 }
4002 3976
4003 } } // namespace v8::internal 3977 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698