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

Side by Side Diff: src/mips/lithium-codegen-mips.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/ia32/lithium-codegen-ia32.cc ('k') | src/mips64/lithium-codegen-mips64.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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 5300 matching lines...) Expand 10 before | Expand all | Expand 10 after
5311 AllocationFlags flags = TAG_OBJECT; 5311 AllocationFlags flags = TAG_OBJECT;
5312 if (instr->hydrogen()->MustAllocateDoubleAligned()) { 5312 if (instr->hydrogen()->MustAllocateDoubleAligned()) {
5313 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); 5313 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
5314 } 5314 }
5315 if (instr->hydrogen()->IsOldSpaceAllocation()) { 5315 if (instr->hydrogen()->IsOldSpaceAllocation()) {
5316 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); 5316 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
5317 flags = static_cast<AllocationFlags>(flags | PRETENURE); 5317 flags = static_cast<AllocationFlags>(flags | PRETENURE);
5318 } 5318 }
5319 if (instr->size()->IsConstantOperand()) { 5319 if (instr->size()->IsConstantOperand()) {
5320 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5320 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5321 if (size <= Page::kMaxRegularHeapObjectSize) { 5321 CHECK(size <= Page::kMaxRegularHeapObjectSize);
5322 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); 5322 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
5323 } else {
5324 __ jmp(deferred->entry());
5325 }
5326 } else { 5323 } else {
5327 Register size = ToRegister(instr->size()); 5324 Register size = ToRegister(instr->size());
5328 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); 5325 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
5329 } 5326 }
5330 5327
5331 __ bind(deferred->exit()); 5328 __ bind(deferred->exit());
5332 5329
5333 if (instr->hydrogen()->MustPrefillWithFiller()) { 5330 if (instr->hydrogen()->MustPrefillWithFiller()) {
5334 STATIC_ASSERT(kHeapObjectTag == 1); 5331 STATIC_ASSERT(kHeapObjectTag == 1);
5335 if (instr->size()->IsConstantOperand()) { 5332 if (instr->size()->IsConstantOperand()) {
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
5893 __ Push(at, ToRegister(instr->function())); 5890 __ Push(at, ToRegister(instr->function()));
5894 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5891 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5895 RecordSafepoint(Safepoint::kNoLazyDeopt); 5892 RecordSafepoint(Safepoint::kNoLazyDeopt);
5896 } 5893 }
5897 5894
5898 5895
5899 #undef __ 5896 #undef __
5900 5897
5901 } // namespace internal 5898 } // namespace internal
5902 } // namespace v8 5899 } // namespace v8
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698