Commit 79888090 authored by verwaest's avatar verwaest Committed by Commit bot

Fix JSObjectFieldAccessor support in crankshaft

BUG=459459
LOG=n

Review URL: https://codereview.chromium.org/940483002

Cr-Commit-Position: refs/heads/master@{#26716}
parent 2ba7f948
...@@ -2462,20 +2462,20 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { ...@@ -2462,20 +2462,20 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
bool IsJSObjectFieldAccessor() { bool IsJSObjectFieldAccessor() {
int offset; // unused int offset; // unused
return Accessors::IsJSObjectFieldAccessor(map(), name_, &offset); return Accessors::IsJSObjectFieldAccessor(map_, name_, &offset);
} }
bool GetJSObjectFieldAccess(HObjectAccess* access) { bool GetJSObjectFieldAccess(HObjectAccess* access) {
int offset; int offset;
if (Accessors::IsJSObjectFieldAccessor(map(), name_, &offset)) { if (Accessors::IsJSObjectFieldAccessor(map_, name_, &offset)) {
if (IsStringType()) { if (IsStringType()) {
DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); DCHECK(String::Equals(isolate()->factory()->length_string(), name_));
*access = HObjectAccess::ForStringLength(); *access = HObjectAccess::ForStringLength();
} else if (IsArrayType()) { } else if (IsArrayType()) {
DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); DCHECK(String::Equals(isolate()->factory()->length_string(), name_));
*access = HObjectAccess::ForArrayLength(map()->elements_kind()); *access = HObjectAccess::ForArrayLength(map_->elements_kind());
} else { } else {
*access = HObjectAccess::ForMapAndOffset(map(), offset); *access = HObjectAccess::ForMapAndOffset(map_, offset);
} }
return true; return true;
} }
......
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