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

Unified Diff: src/ast/ast.h

Issue 1638353002: [fullcodegen] Cleanup MustCreateObjectLiteralWithRuntime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 11 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 | « no previous file | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index d182b399f7e6c00f47f47258a888334833a478f4..b2103b04e32d747afbc44070fe9e3b5bdba276af 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -1517,6 +1517,9 @@ class ObjectLiteral final : public MaterializedLiteral {
bool may_store_doubles() const { return may_store_doubles_; }
bool has_function() const { return has_function_; }
bool has_elements() const { return has_elements_; }
+ bool has_shallow_properties() const {
+ return depth() == 1 && !has_elements() && !may_store_doubles();
+ }
// Decide if a property should be in the object boilerplate.
static bool IsBoilerplateProperty(Property* property);
@@ -1533,7 +1536,7 @@ class ObjectLiteral final : public MaterializedLiteral {
int ComputeFlags(bool disable_mementos = false) const {
int flags = fast_elements() ? kFastElements : kNoFlags;
flags |= has_function() ? kHasFunction : kNoFlags;
- if (depth() == 1 && !has_elements() && !may_store_doubles()) {
+ if (has_shallow_properties()) {
flags |= kShallowProperties;
}
if (disable_mementos) {
« no previous file with comments | « no previous file | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698