| Index: src/hydrogen.h
|
| diff --git a/src/hydrogen.h b/src/hydrogen.h
|
| index a371fa571b8e3e370a495e4f19dba88f2f916d89..4c1c58fa9407973a15225ddad59a7b7c434ca044 100644
|
| --- a/src/hydrogen.h
|
| +++ b/src/hydrogen.h
|
| @@ -30,6 +30,7 @@
|
|
|
| #include "v8.h"
|
|
|
| +#include "accessors.h"
|
| #include "allocation.h"
|
| #include "ast.h"
|
| #include "compiler.h"
|
| @@ -2037,19 +2038,26 @@ class HOptimizedGraphBuilder V8_FINAL
|
| // PropertyAccessInfo is built for types->first().
|
| bool CanLoadAsMonomorphic(SmallMapList* types);
|
|
|
| - bool IsStringLength() {
|
| - return map_->instance_type() < FIRST_NONSTRING_TYPE &&
|
| - name_->Equals(isolate()->heap()->length_string());
|
| + bool IsJSObjectFieldAccessor() {
|
| + int offset; // unused
|
| + return Accessors::IsJSObjectFieldAccessor(map_, name_, &offset);
|
| }
|
|
|
| - bool IsArrayLength() {
|
| - return map_->instance_type() == JS_ARRAY_TYPE &&
|
| - name_->Equals(isolate()->heap()->length_string());
|
| - }
|
| -
|
| - bool IsTypedArrayLength() {
|
| - return map_->instance_type() == JS_TYPED_ARRAY_TYPE &&
|
| - name_->Equals(isolate()->heap()->length_string());
|
| + bool GetJSObjectFieldAccess(HObjectAccess* access) {
|
| + if (IsStringLength()) {
|
| + *access = HObjectAccess::ForStringLength();
|
| + return true;
|
| + } else if (IsArrayLength()) {
|
| + *access = HObjectAccess::ForArrayLength(map_->elements_kind());
|
| + return true;
|
| + } else {
|
| + int offset;
|
| + if (Accessors::IsJSObjectFieldAccessor(map_, name_, &offset)) {
|
| + *access = HObjectAccess::ForJSObjectOffset(offset);
|
| + return true;
|
| + }
|
| + return false;
|
| + }
|
| }
|
|
|
| bool has_holder() { return !holder_.is_null(); }
|
| @@ -2064,6 +2072,16 @@ class HOptimizedGraphBuilder V8_FINAL
|
| private:
|
| Isolate* isolate() { return lookup_.isolate(); }
|
|
|
| + bool IsStringLength() {
|
| + return map_->instance_type() < FIRST_NONSTRING_TYPE &&
|
| + name_->Equals(isolate()->heap()->length_string());
|
| + }
|
| +
|
| + bool IsArrayLength() {
|
| + return map_->instance_type() == JS_ARRAY_TYPE &&
|
| + name_->Equals(isolate()->heap()->length_string());
|
| + }
|
| +
|
| bool LoadResult(Handle<Map> map);
|
| bool LookupDescriptor();
|
| bool LookupInPrototypes();
|
| @@ -2164,10 +2182,6 @@ class HOptimizedGraphBuilder V8_FINAL
|
| HInstruction* BuildLoadNamedGeneric(HValue* object,
|
| Handle<String> name,
|
| Property* expr);
|
| - HInstruction* BuildCallGetter(HValue* object,
|
| - Handle<Map> map,
|
| - Handle<JSFunction> getter,
|
| - Handle<JSObject> holder);
|
|
|
| HCheckMaps* AddCheckMap(HValue* object, Handle<Map> map);
|
|
|
|
|