Commit 04131452 authored by vogelheim's avatar vogelheim Committed by Commit bot

Speedup access to global_proxy.* attributes/accessors.

Using a global proxy (e.g. 'window.f', 'w.f' or 'this.f') is considerably slower than evaluating just 'f'. This CL aims to perform the necessary checks at compile time and inline the accesses.

This is a follow-on CL to crrev.com/2369933005:
- The initial upload is crrev.com/2369933005 + a rebase.
- The remaining issues are the fixes requested by the reviewers on that CL.

BUG=chromium:634276, chromium:654716

Committed: https://crrev.com/8f43d748272536117008aa6a1b53ea52126261c1
Review-Url: https://codereview.chromium.org/2403003002
Cr-Original-Commit-Position: refs/heads/master@{#40153}
Cr-Commit-Position: refs/heads/master@{#40365}
parent dd144bbb
This diff is collapsed.
...@@ -2342,14 +2342,16 @@ class HOptimizedGraphBuilder : public HGraphBuilder, ...@@ -2342,14 +2342,16 @@ class HOptimizedGraphBuilder : public HGraphBuilder,
#undef DECLARE_VISIT #undef DECLARE_VISIT
private: private:
// Helpers for flow graph construction. bool CanInlineGlobalPropertyAccess(Variable* var, LookupIterator* it,
enum GlobalPropertyAccess { PropertyAccessType access_type);
kUseCell,
kUseGeneric bool CanInlineGlobalPropertyAccess(LookupIterator* it,
};
GlobalPropertyAccess LookupGlobalProperty(Variable* var, LookupIterator* it,
PropertyAccessType access_type); PropertyAccessType access_type);
void InlineGlobalPropertyLoad(LookupIterator* it, BailoutId ast_id);
HInstruction* InlineGlobalPropertyStore(LookupIterator* it, HValue* value,
BailoutId ast_id);
void EnsureArgumentsArePushedForAccess(); void EnsureArgumentsArePushedForAccess();
bool TryArgumentsAccess(Property* expr); bool TryArgumentsAccess(Property* expr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment