| Index: src/hydrogen.h
|
| diff --git a/src/hydrogen.h b/src/hydrogen.h
|
| index 6aa82177cf8aa1a5581d153b93abf5c19633e29a..9b998c92b9282e6d2a14abcdd30dd5ff771b96c7 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"
|
| @@ -1780,6 +1781,8 @@ class HOptimizedGraphBuilder V8_FINAL
|
|
|
| HValue* context() { return environment()->context(); }
|
|
|
| + HOsrBuilder* osr() const { return osr_; }
|
| +
|
| void Bailout(BailoutReason reason);
|
|
|
| HBasicBlock* CreateJoin(HBasicBlock* first,
|
| @@ -1885,6 +1888,12 @@ class HOptimizedGraphBuilder V8_FINAL
|
| HBasicBlock* loop_successor,
|
| HBasicBlock* break_block);
|
|
|
| + // Build a loop entry
|
| + HBasicBlock* BuildLoopEntry();
|
| +
|
| + // Builds a loop entry respectful of OSR requirements
|
| + HBasicBlock* BuildLoopEntry(IterationStatement* statement);
|
| +
|
| HBasicBlock* JoinContinue(IterationStatement* statement,
|
| HBasicBlock* exit_block,
|
| HBasicBlock* continue_block);
|
| @@ -2046,19 +2055,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(); }
|
| @@ -2073,6 +2089,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();
|
| @@ -2173,10 +2199,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);
|
|
|
|
|