Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: src/ast.h

Issue 13542002: Calling a generator function returns a generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Link generator iterator definitions and uses through local variable Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/factory.h » ('j') | src/objects.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 bool is_monomorphic_ : 1; 1955 bool is_monomorphic_ : 1;
1956 KeyedAccessStoreMode store_mode_ : 4; 1956 KeyedAccessStoreMode store_mode_ : 4;
1957 SmallMapList receiver_types_; 1957 SmallMapList receiver_types_;
1958 }; 1958 };
1959 1959
1960 1960
1961 class Yield: public Expression { 1961 class Yield: public Expression {
1962 public: 1962 public:
1963 DECLARE_NODE_TYPE(Yield) 1963 DECLARE_NODE_TYPE(Yield)
1964 1964
1965 Expression* iterator() const { return iterator_; }
1965 Expression* expression() const { return expression_; } 1966 Expression* expression() const { return expression_; }
1966 bool is_delegating_yield() const { return is_delegating_yield_; } 1967 bool is_delegating_yield() const { return is_delegating_yield_; }
1967 virtual int position() const { return pos_; } 1968 virtual int position() const { return pos_; }
1968 1969
1969 protected: 1970 protected:
1970 Yield(Isolate* isolate, 1971 Yield(Isolate* isolate,
1972 Expression* iterator,
1971 Expression* expression, 1973 Expression* expression,
1972 bool is_delegating_yield, 1974 bool is_delegating_yield,
1973 int pos) 1975 int pos)
1974 : Expression(isolate), 1976 : Expression(isolate),
1977 iterator_(iterator),
1975 expression_(expression), 1978 expression_(expression),
1976 is_delegating_yield_(is_delegating_yield), 1979 is_delegating_yield_(is_delegating_yield),
1977 pos_(pos) { } 1980 pos_(pos) { }
1978 1981
1979 private: 1982 private:
1983 Expression* iterator_;
1980 Expression* expression_; 1984 Expression* expression_;
1981 bool is_delegating_yield_; 1985 bool is_delegating_yield_;
1982 int pos_; 1986 int pos_;
1983 }; 1987 };
1984 1988
1985 1989
1986 class Throw: public Expression { 1990 class Throw: public Expression {
1987 public: 1991 public:
1988 DECLARE_NODE_TYPE(Throw) 1992 DECLARE_NODE_TYPE(Throw)
1989 1993
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2951 Assignment* NewAssignment(Token::Value op, 2955 Assignment* NewAssignment(Token::Value op,
2952 Expression* target, 2956 Expression* target,
2953 Expression* value, 2957 Expression* value,
2954 int pos) { 2958 int pos) {
2955 Assignment* assign = 2959 Assignment* assign =
2956 new(zone_) Assignment(isolate_, op, target, value, pos); 2960 new(zone_) Assignment(isolate_, op, target, value, pos);
2957 assign->Init(isolate_, this); 2961 assign->Init(isolate_, this);
2958 VISIT_AND_RETURN(Assignment, assign) 2962 VISIT_AND_RETURN(Assignment, assign)
2959 } 2963 }
2960 2964
2961 Yield* NewYield(Expression* expression, bool is_delegating_yield, int pos) { 2965 Yield* NewYield(Expression *iterator, Expression* expression,
2962 Yield* yield = 2966 bool is_delegating_yield, int pos) {
2963 new(zone_) Yield(isolate_, expression, is_delegating_yield, pos); 2967 Yield* yield = new(zone_) Yield(isolate_, iterator, expression,
2968 is_delegating_yield, pos);
2964 VISIT_AND_RETURN(Yield, yield) 2969 VISIT_AND_RETURN(Yield, yield)
2965 } 2970 }
2966 2971
2967 Throw* NewThrow(Expression* exception, int pos) { 2972 Throw* NewThrow(Expression* exception, int pos) {
2968 Throw* t = new(zone_) Throw(isolate_, exception, pos); 2973 Throw* t = new(zone_) Throw(isolate_, exception, pos);
2969 VISIT_AND_RETURN(Throw, t) 2974 VISIT_AND_RETURN(Throw, t)
2970 } 2975 }
2971 2976
2972 FunctionLiteral* NewFunctionLiteral( 2977 FunctionLiteral* NewFunctionLiteral(
2973 Handle<String> name, 2978 Handle<String> name,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 private: 3019 private:
3015 Isolate* isolate_; 3020 Isolate* isolate_;
3016 Zone* zone_; 3021 Zone* zone_;
3017 Visitor visitor_; 3022 Visitor visitor_;
3018 }; 3023 };
3019 3024
3020 3025
3021 } } // namespace v8::internal 3026 } } // namespace v8::internal
3022 3027
3023 #endif // V8_AST_H_ 3028 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/factory.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698