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

Side by Side Diff: src/compiler/memory-optimizer.cc

Issue 2311203002: Move kMaxRegularHeapObjectSize into globals (Closed)
Patch Set: Saving the file helps... Created 4 years, 3 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
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/crankshaft/arm/lithium-codegen-arm.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/memory-optimizer.h" 5 #include "src/compiler/memory-optimizer.h"
6 6
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 ? ExternalReference::new_space_allocation_top_address(isolate()) 115 ? ExternalReference::new_space_allocation_top_address(isolate())
116 : ExternalReference::old_space_allocation_top_address(isolate())); 116 : ExternalReference::old_space_allocation_top_address(isolate()));
117 Node* limit_address = jsgraph()->ExternalConstant( 117 Node* limit_address = jsgraph()->ExternalConstant(
118 pretenure == NOT_TENURED 118 pretenure == NOT_TENURED
119 ? ExternalReference::new_space_allocation_limit_address(isolate()) 119 ? ExternalReference::new_space_allocation_limit_address(isolate())
120 : ExternalReference::old_space_allocation_limit_address(isolate())); 120 : ExternalReference::old_space_allocation_limit_address(isolate()));
121 121
122 // Check if we can fold this allocation into a previous allocation represented 122 // Check if we can fold this allocation into a previous allocation represented
123 // by the incoming {state}. 123 // by the incoming {state}.
124 Int32Matcher m(size); 124 Int32Matcher m(size);
125 if (m.HasValue() && m.Value() < Page::kMaxRegularHeapObjectSize) { 125 if (m.HasValue() && m.Value() < kMaxRegularHeapObjectSize) {
126 int32_t const object_size = m.Value(); 126 int32_t const object_size = m.Value();
127 if (state->size() <= Page::kMaxRegularHeapObjectSize - object_size && 127 if (state->size() <= kMaxRegularHeapObjectSize - object_size &&
128 state->group()->pretenure() == pretenure) { 128 state->group()->pretenure() == pretenure) {
129 // We can fold this Allocate {node} into the allocation {group} 129 // We can fold this Allocate {node} into the allocation {group}
130 // represented by the given {state}. Compute the upper bound for 130 // represented by the given {state}. Compute the upper bound for
131 // the new {state}. 131 // the new {state}.
132 int32_t const state_size = state->size() + object_size; 132 int32_t const state_size = state->size() + object_size;
133 133
134 // Update the reservation check to the actual maximum upper bound. 134 // Update the reservation check to the actual maximum upper bound.
135 AllocationGroup* const group = state->group(); 135 AllocationGroup* const group = state->group();
136 if (OpParameter<int32_t>(group->size()) < state_size) { 136 if (OpParameter<int32_t>(group->size()) < state_size) {
137 NodeProperties::ChangeOp(group->size(), 137 NodeProperties::ChangeOp(group->size(),
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 return jsgraph()->common(); 494 return jsgraph()->common();
495 } 495 }
496 496
497 MachineOperatorBuilder* MemoryOptimizer::machine() const { 497 MachineOperatorBuilder* MemoryOptimizer::machine() const {
498 return jsgraph()->machine(); 498 return jsgraph()->machine();
499 } 499 }
500 500
501 } // namespace compiler 501 } // namespace compiler
502 } // namespace internal 502 } // namespace internal
503 } // namespace v8 503 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698