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

Unified Diff: src/hydrogen.cc

Issue 21089006: Allocation space decisions are precisely made in hydrogen. (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 side-by-side diff with in-line comments
Download patch
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index d98ce2ff3c8ca0f0322464e1387bbae1d6848653..3158ca86c8f679be4f1e58ec339faaf12a18211a 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1329,11 +1329,11 @@ HValue* HGraphBuilder::BuildAllocateElements(HValue* context,
// TODO(hpayer): When pretenuring can be internalized, flags can become
// private to HAllocate.
if (IsFastDoubleElementsKind(kind)) {
- flags = static_cast<HAllocate::Flags>(
- flags | HAllocate::CAN_ALLOCATE_IN_OLD_DATA_SPACE);
+ flags = HAllocate::SetAllocationFlag(flags,
+ HAllocate::ALLOCATE_IN_OLD_DATA_SPACE);
} else {
- flags = static_cast<HAllocate::Flags>(
- flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE);
+ flags = HAllocate::SetAllocationFlag(flags,
+ HAllocate::ALLOCATE_IN_OLD_POINTER_SPACE);
}
}
@@ -4604,7 +4604,7 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
HInstruction* heap_number_size = Add<HConstant>(HeapNumber::kSize);
HInstruction* heap_number = Add<HAllocate>(
environment()->LookupContext(), heap_number_size,
- HType::HeapNumber(), HAllocate::CAN_ALLOCATE_IN_NEW_SPACE);
+ HType::HeapNumber(), HAllocate::DefaultFlags());
AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map());
AddStore(heap_number, HObjectAccess::ForHeapNumberValue(), value);
instr = new(zone()) HStoreNamedField(
@@ -7243,8 +7243,8 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
HAllocate::Flags flags = HAllocate::DefaultFlags();
if (FLAG_pretenuring_call_new &&
isolate()->heap()->ShouldGloballyPretenure()) {
- flags = static_cast<HAllocate::Flags>(
- flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE);
+ flags = HAllocate::SetAllocationFlag(flags,
+ HAllocate::ALLOCATE_IN_OLD_POINTER_SPACE);
}
HAllocate* receiver =
Add<HAllocate>(context, size_in_bytes, HType::JSObject(), flags);
@@ -8329,9 +8329,9 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
if (isolate()->heap()->ShouldGloballyPretenure()) {
if (data_size != 0) {
- HAllocate::Flags data_flags =
- static_cast<HAllocate::Flags>(HAllocate::DefaultFlags(kind) |
- HAllocate::CAN_ALLOCATE_IN_OLD_DATA_SPACE);
+ HAllocate::Flags data_flags = HAllocate::DefaultFlags(kind);
+ data_flags = HAllocate::SetAllocationFlag(data_flags,
+ HAllocate::ALLOCATE_IN_OLD_DATA_SPACE);
HValue* size_in_bytes = Add<HConstant>(data_size);
data_target = Add<HAllocate>(context, size_in_bytes, HType::JSObject(),
data_flags);
@@ -8342,9 +8342,9 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
AddStore(data_target, access, size_in_bytes);
}
if (pointer_size != 0) {
- HAllocate::Flags pointer_flags =
- static_cast<HAllocate::Flags>(HAllocate::DefaultFlags() |
- HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE);
+ HAllocate::Flags pointer_flags = HAllocate::DefaultFlags();
+ pointer_flags = HAllocate::SetAllocationFlag(pointer_flags,
+ HAllocate::ALLOCATE_IN_OLD_POINTER_SPACE);
HValue* size_in_bytes = Add<HConstant>(pointer_size);
target = Add<HAllocate>(context, size_in_bytes, HType::JSObject(),
pointer_flags);

Powered by Google App Engine
This is Rietveld 408576698