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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 1406593002: Do not allow large object allocation from optimized code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/arm64/lithium-codegen-arm64.cc ('k') | src/mips/lithium-codegen-mips.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 // 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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 5169 matching lines...) Expand 10 before | Expand all | Expand 10 after
5180 if (instr->hydrogen()->MustAllocateDoubleAligned()) { 5180 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
5181 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 5181 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
5182 } 5182 }
5183 if (instr->hydrogen()->IsOldSpaceAllocation()) { 5183 if (instr->hydrogen()->IsOldSpaceAllocation()) {
5184 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); 5184 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
5185 flags = static_cast<AllocationFlags>(flags | PRETENURE); 5185 flags = static_cast<AllocationFlags>(flags | PRETENURE);
5186 } 5186 }
5187 5187
5188 if (instr->size()->IsConstantOperand()) { 5188 if (instr->size()->IsConstantOperand()) {
5189 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5189 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5190 if (size <= Page::kMaxRegularHeapObjectSize) { 5190 CHECK(size <= Page::kMaxRegularHeapObjectSize);
5191 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); 5191 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
5192 } else {
5193 __ jmp(deferred->entry());
5194 }
5195 } else { 5192 } else {
5196 Register size = ToRegister(instr->size()); 5193 Register size = ToRegister(instr->size());
5197 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); 5194 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
5198 } 5195 }
5199 5196
5200 __ bind(deferred->exit()); 5197 __ bind(deferred->exit());
5201 5198
5202 if (instr->hydrogen()->MustPrefillWithFiller()) { 5199 if (instr->hydrogen()->MustPrefillWithFiller()) {
5203 if (instr->size()->IsConstantOperand()) { 5200 if (instr->size()->IsConstantOperand()) {
5204 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5201 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
5717 RecordSafepoint(Safepoint::kNoLazyDeopt); 5714 RecordSafepoint(Safepoint::kNoLazyDeopt);
5718 } 5715 }
5719 5716
5720 5717
5721 #undef __ 5718 #undef __
5722 5719
5723 } // namespace internal 5720 } // namespace internal
5724 } // namespace v8 5721 } // namespace v8
5725 5722
5726 #endif // V8_TARGET_ARCH_IA32 5723 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698