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

Side by Side Diff: src/code-stubs.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-stub-assembler.cc ('k') | src/code-stubs-hydrogen.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 #include "src/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 5709 matching lines...) Expand 10 before | Expand all | Expand 10 after
5720 5720
5721 assembler->Bind(&abort); 5721 assembler->Bind(&abort);
5722 Node* reason = 5722 Node* reason =
5723 assembler->SmiConstant(Smi::FromInt(kAllocatingNonEmptyPackedArray)); 5723 assembler->SmiConstant(Smi::FromInt(kAllocatingNonEmptyPackedArray));
5724 Node* context = assembler->Parameter(Descriptor::kContext); 5724 Node* context = assembler->Parameter(Descriptor::kContext);
5725 assembler->TailCallRuntime(Runtime::kAbort, context, reason); 5725 assembler->TailCallRuntime(Runtime::kAbort, context, reason);
5726 } else { 5726 } else {
5727 int element_size = 5727 int element_size =
5728 IsFastDoubleElementsKind(elements_kind) ? kDoubleSize : kPointerSize; 5728 IsFastDoubleElementsKind(elements_kind) ? kDoubleSize : kPointerSize;
5729 int max_fast_elements = 5729 int max_fast_elements =
5730 (Page::kMaxRegularHeapObjectSize - FixedArray::kHeaderSize - 5730 (kMaxRegularHeapObjectSize - FixedArray::kHeaderSize - JSArray::kSize -
5731 JSArray::kSize - AllocationMemento::kSize) / 5731 AllocationMemento::kSize) /
5732 element_size; 5732 element_size;
5733 assembler->Branch( 5733 assembler->Branch(
5734 assembler->SmiAboveOrEqual( 5734 assembler->SmiAboveOrEqual(
5735 size, assembler->SmiConstant(Smi::FromInt(max_fast_elements))), 5735 size, assembler->SmiConstant(Smi::FromInt(max_fast_elements))),
5736 &call_runtime, &small_smi_size); 5736 &call_runtime, &small_smi_size);
5737 } 5737 }
5738 5738
5739 assembler->Bind(&small_smi_size); 5739 assembler->Bind(&small_smi_size);
5740 { 5740 {
5741 Node* array = assembler->AllocateJSArray( 5741 Node* array = assembler->AllocateJSArray(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
5848 5848
5849 if (type == MachineType::Pointer()) { 5849 if (type == MachineType::Pointer()) {
5850 return Representation::External(); 5850 return Representation::External();
5851 } 5851 }
5852 5852
5853 return Representation::Tagged(); 5853 return Representation::Tagged();
5854 } 5854 }
5855 5855
5856 } // namespace internal 5856 } // namespace internal
5857 } // namespace v8 5857 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698