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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 23622016: limit InitialMaxFastElement by MaxRegularSpaceAllocationSize (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Created 7 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 | « no previous file | src/elements.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 // 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 JSArrayBuilder* array_builder) { 638 JSArrayBuilder* array_builder) {
639 // Smi check and range check on the input arg. 639 // Smi check and range check on the input arg.
640 HValue* constant_one = graph()->GetConstant1(); 640 HValue* constant_one = graph()->GetConstant1();
641 HValue* constant_zero = graph()->GetConstant0(); 641 HValue* constant_zero = graph()->GetConstant0();
642 642
643 HInstruction* elements = Add<HArgumentsElements>(false); 643 HInstruction* elements = Add<HArgumentsElements>(false);
644 HInstruction* argument = AddInstruction( 644 HInstruction* argument = AddInstruction(
645 new(zone()) HAccessArgumentsAt(elements, constant_one, constant_zero)); 645 new(zone()) HAccessArgumentsAt(elements, constant_one, constant_zero));
646 646
647 HConstant* max_alloc_length = 647 HConstant* max_alloc_length =
648 Add<HConstant>(JSObject::kInitialMaxFastElementArray); 648 Add<HConstant>(JSObject::InitialMaxFastElementArray(isolate()->heap()));
649 const int initial_capacity = JSArray::kPreallocatedArrayElements; 649 const int initial_capacity = JSArray::kPreallocatedArrayElements;
650 HConstant* initial_capacity_node = New<HConstant>(initial_capacity); 650 HConstant* initial_capacity_node = New<HConstant>(initial_capacity);
651 AddInstruction(initial_capacity_node); 651 AddInstruction(initial_capacity_node);
652 652
653 HInstruction* checked_arg = Add<HBoundsCheck>(argument, max_alloc_length); 653 HInstruction* checked_arg = Add<HBoundsCheck>(argument, max_alloc_length);
654 IfBuilder if_builder(this); 654 IfBuilder if_builder(this);
655 if_builder.If<HCompareNumericAndBranch>(checked_arg, constant_zero, 655 if_builder.If<HCompareNumericAndBranch>(checked_arg, constant_zero,
656 Token::EQ); 656 Token::EQ);
657 if_builder.Then(); 657 if_builder.Then();
658 Push(initial_capacity_node); // capacity 658 Push(initial_capacity_node); // capacity
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 return js_function; 1095 return js_function;
1096 } 1096 }
1097 1097
1098 1098
1099 Handle<Code> FastNewClosureStub::GenerateCode() { 1099 Handle<Code> FastNewClosureStub::GenerateCode() {
1100 return DoGenerateCode(this); 1100 return DoGenerateCode(this);
1101 } 1101 }
1102 1102
1103 1103
1104 } } // namespace v8::internal 1104 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698