diff options
Diffstat (limited to 'deps/v8/src/hydrogen.h')
-rw-r--r-- | deps/v8/src/hydrogen.h | 71 |
1 files changed, 50 insertions, 21 deletions
diff --git a/deps/v8/src/hydrogen.h b/deps/v8/src/hydrogen.h index c6953cdad5..c1215a33ba 100644 --- a/deps/v8/src/hydrogen.h +++ b/deps/v8/src/hydrogen.h @@ -613,6 +613,8 @@ class HEnvironment final : public ZoneObject { void SetExpressionStackAt(int index_from_top, HValue* value); HValue* RemoveExpressionStackAt(int index_from_top); + void Print() const; + HEnvironment* Copy() const; HEnvironment* CopyWithoutHistory() const; HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; @@ -1356,6 +1358,9 @@ class HGraphBuilder { HValue* hash, LanguageMode language_mode); + // ES6 section 7.4.7 CreateIterResultObject ( value, done ) + HValue* BuildCreateIterResultObject(HValue* value, HValue* done); + HValue* BuildRegExpConstructResult(HValue* length, HValue* index, HValue* input); @@ -1443,7 +1448,7 @@ class HGraphBuilder { ElementsKind kind, HValue *dependency = NULL); - HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin); + HValue* AddLoadJSBuiltin(int context_index); HValue* EnforceNumberType(HValue* number, Type* expected); HValue* TruncateToNumber(HValue* value, Type** expected); @@ -1889,6 +1894,9 @@ class HGraphBuilder { // the SourcePosition assuming that this position corresponds to the // same function as current position_. SourcePosition ScriptPositionToSourcePosition(int position) { + if (position == RelocInfo::kNoPosition) { + return SourcePosition::Unknown(); + } SourcePosition pos = position_; pos.set_position(position - start_position_); return pos; @@ -2000,10 +2008,9 @@ inline HInstruction* HGraphBuilder::AddUncasted<HReturn>(HConstant* value) { template<> inline HCallRuntime* HGraphBuilder::Add<HCallRuntime>( - Handle<String> name, const Runtime::Function* c_function, int argument_count) { - HCallRuntime* instr = New<HCallRuntime>(name, c_function, argument_count); + HCallRuntime* instr = New<HCallRuntime>(c_function, argument_count); if (graph()->info()->IsStub()) { // When compiling code stubs, we don't want to save all double registers // upon entry to the stub, but instead have the call runtime instruction @@ -2020,21 +2027,42 @@ inline HInstruction* HGraphBuilder::AddUncasted<HCallRuntime>( Handle<String> name, const Runtime::Function* c_function, int argument_count) { - return Add<HCallRuntime>(name, c_function, argument_count); + return Add<HCallRuntime>(c_function, argument_count); } -template<> -inline HContext* HGraphBuilder::New<HContext>() { - return HContext::New(zone()); +template <> +inline HParameter* HGraphBuilder::New<HParameter>(unsigned index) { + return HParameter::New(isolate(), zone(), nullptr, index); } -template<> -inline HInstruction* HGraphBuilder::NewUncasted<HContext>() { - return New<HContext>(); +template <> +inline HParameter* HGraphBuilder::New<HParameter>( + unsigned index, HParameter::ParameterKind kind) { + return HParameter::New(isolate(), zone(), nullptr, index, kind); } + +template <> +inline HParameter* HGraphBuilder::New<HParameter>( + unsigned index, HParameter::ParameterKind kind, Representation r) { + return HParameter::New(isolate(), zone(), nullptr, index, kind, r); +} + + +template <> +inline HPrologue* HGraphBuilder::New<HPrologue>() { + return HPrologue::New(zone()); +} + + +template <> +inline HContext* HGraphBuilder::New<HContext>() { + return HContext::New(zone()); +} + + class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { public: // A class encapsulating (lazily-allocated) break and continue blocks for @@ -2181,6 +2209,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { F(IsRegExp) \ F(IsJSProxy) \ F(IsConstructCall) \ + F(Call) \ F(CallFunction) \ F(ArgumentsLength) \ F(Arguments) \ @@ -2194,8 +2223,9 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { F(OneByteSeqStringSetChar) \ F(TwoByteSeqStringSetChar) \ F(ObjectEquals) \ - F(IsObject) \ + F(ToInteger) \ F(ToObject) \ + F(ToString) \ F(IsFunction) \ F(IsSpecObject) \ F(MathPow) \ @@ -2207,13 +2237,13 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { F(StringCharCodeAt) \ F(StringAdd) \ F(SubString) \ - F(StringCompare) \ F(RegExpExec) \ F(RegExpConstructResult) \ F(NumberToString) \ F(DebugIsActive) \ F(Likely) \ F(Unlikely) \ + F(HasInPrototypeChain) \ /* Typed Arrays */ \ F(TypedArrayInitialize) \ F(DataViewInitialize) \ @@ -2242,9 +2272,10 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { F(JSCollectionGetTable) \ F(StringGetRawHashField) \ F(TheHole) \ + /* ES6 Iterators */ \ + F(CreateIterResultObject) \ /* Arrays */ \ F(HasFastPackedElements) \ - F(GetPrototype) \ /* Strings */ \ F(StringGetLength) \ /* JSValue */ \ @@ -2514,7 +2545,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { public: PropertyAccessInfo(HOptimizedGraphBuilder* builder, PropertyAccessType access_type, Handle<Map> map, - Handle<String> name) + Handle<Name> name) : builder_(builder), access_type_(access_type), map_(map), @@ -2540,7 +2571,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { bool NeedsWrappingFor(Handle<JSFunction> target) const; Handle<Map> map(); - Handle<String> name() const { return name_; } + Handle<Name> name() const { return name_; } bool IsJSObjectFieldAccessor() { int offset; // unused @@ -2551,10 +2582,10 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { int offset; if (Accessors::IsJSObjectFieldAccessor(map_, name_, &offset)) { if (IsStringType()) { - DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); + DCHECK(Name::Equals(isolate()->factory()->length_string(), name_)); *access = HObjectAccess::ForStringLength(); } else if (IsArrayType()) { - DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); + DCHECK(Name::Equals(isolate()->factory()->length_string(), name_)); *access = HObjectAccess::ForArrayLength(map_->elements_kind()); } else { *access = HObjectAccess::ForMapAndOffset(map_, offset); @@ -2687,7 +2718,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { HOptimizedGraphBuilder* builder_; PropertyAccessType access_type_; Handle<Map> map_; - Handle<String> name_; + Handle<Name> name_; Handle<JSObject> holder_; Handle<JSFunction> accessor_; Handle<JSObject> api_holder_; @@ -2835,9 +2866,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { void AddCheckPrototypeMaps(Handle<JSObject> holder, Handle<Map> receiver_map); - HInstruction* NewPlainFunctionCall(HValue* fun, - int argument_count, - bool pass_argument_count); + HInstruction* NewPlainFunctionCall(HValue* fun, int argument_count); HInstruction* NewArgumentAdaptorCall(HValue* fun, HValue* context, int argument_count, |