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

Unified Diff: src/code-stub-assembler.cc

Issue 2445333002: Ensure slow properties for simple {__proto__:null} literals. (Closed)
Patch Set: fixing compilation issue Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/contexts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index edcebec1f1f95ca6df022c93b7283b7b84cdaf6a..ca2dce3c196be6fa84fa45bf5245788e15da28a4 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -2047,6 +2047,21 @@ Node* CodeStubAssembler::AllocateNameDictionary(Node* at_least_space_for) {
return result;
}
+Node* CodeStubAssembler::CopyNameDictionary(Node* dictionary,
+ Label* large_object_fallback) {
+ Comment("Copy boilerplate property dict");
+ Label done(this);
+ Node* length = SmiUntag(LoadFixedArrayBaseLength(dictionary));
+ GotoIf(
+ IntPtrGreaterThan(length, IntPtrConstant(FixedArray::kMaxRegularLength)),
+ large_object_fallback);
+ Node* properties =
+ AllocateNameDictionary(SmiUntag(GetCapacity<NameDictionary>(dictionary)));
+ CopyFixedArrayElements(FAST_ELEMENTS, dictionary, properties, length,
+ SKIP_WRITE_BARRIER, INTPTR_PARAMETERS);
+ return properties;
+}
+
Node* CodeStubAssembler::AllocateJSObjectFromMap(Node* map, Node* properties,
Node* elements,
AllocationFlags flags) {
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698