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

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: Fix nits; generator object fields are undefined if not set 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/full-codegen.cc » ('j') | no next file with comments »
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 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after
1957 KeyedAccessStoreMode store_mode_ : 5; // Windows treats as signed, 1957 KeyedAccessStoreMode store_mode_ : 5; // Windows treats as signed,
1958 // must have extra bit. 1958 // must have extra bit.
1959 SmallMapList receiver_types_; 1959 SmallMapList receiver_types_;
1960 }; 1960 };
1961 1961
1962 1962
1963 class Yield: public Expression { 1963 class Yield: public Expression {
1964 public: 1964 public:
1965 DECLARE_NODE_TYPE(Yield) 1965 DECLARE_NODE_TYPE(Yield)
1966 1966
1967 Expression* generator_object() const { return generator_object_; }
1967 Expression* expression() const { return expression_; } 1968 Expression* expression() const { return expression_; }
1968 bool is_delegating_yield() const { return is_delegating_yield_; } 1969 bool is_delegating_yield() const { return is_delegating_yield_; }
1969 virtual int position() const { return pos_; } 1970 virtual int position() const { return pos_; }
1970 1971
1971 protected: 1972 protected:
1972 Yield(Isolate* isolate, 1973 Yield(Isolate* isolate,
1974 Expression* generator_object,
1973 Expression* expression, 1975 Expression* expression,
1974 bool is_delegating_yield, 1976 bool is_delegating_yield,
1975 int pos) 1977 int pos)
1976 : Expression(isolate), 1978 : Expression(isolate),
1979 generator_object_(generator_object),
1977 expression_(expression), 1980 expression_(expression),
1978 is_delegating_yield_(is_delegating_yield), 1981 is_delegating_yield_(is_delegating_yield),
1979 pos_(pos) { } 1982 pos_(pos) { }
1980 1983
1981 private: 1984 private:
1985 Expression* generator_object_;
1982 Expression* expression_; 1986 Expression* expression_;
1983 bool is_delegating_yield_; 1987 bool is_delegating_yield_;
1984 int pos_; 1988 int pos_;
1985 }; 1989 };
1986 1990
1987 1991
1988 class Throw: public Expression { 1992 class Throw: public Expression {
1989 public: 1993 public:
1990 DECLARE_NODE_TYPE(Throw) 1994 DECLARE_NODE_TYPE(Throw)
1991 1995
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2953 Assignment* NewAssignment(Token::Value op, 2957 Assignment* NewAssignment(Token::Value op,
2954 Expression* target, 2958 Expression* target,
2955 Expression* value, 2959 Expression* value,
2956 int pos) { 2960 int pos) {
2957 Assignment* assign = 2961 Assignment* assign =
2958 new(zone_) Assignment(isolate_, op, target, value, pos); 2962 new(zone_) Assignment(isolate_, op, target, value, pos);
2959 assign->Init(isolate_, this); 2963 assign->Init(isolate_, this);
2960 VISIT_AND_RETURN(Assignment, assign) 2964 VISIT_AND_RETURN(Assignment, assign)
2961 } 2965 }
2962 2966
2963 Yield* NewYield(Expression* expression, bool is_delegating_yield, int pos) { 2967 Yield* NewYield(Expression *generator_object,
2964 Yield* yield = 2968 Expression* expression,
2965 new(zone_) Yield(isolate_, expression, is_delegating_yield, pos); 2969 bool is_delegating_yield,
2970 int pos) {
2971 Yield* yield = new(zone_) Yield(
2972 isolate_, generator_object, expression, is_delegating_yield, pos);
2966 VISIT_AND_RETURN(Yield, yield) 2973 VISIT_AND_RETURN(Yield, yield)
2967 } 2974 }
2968 2975
2969 Throw* NewThrow(Expression* exception, int pos) { 2976 Throw* NewThrow(Expression* exception, int pos) {
2970 Throw* t = new(zone_) Throw(isolate_, exception, pos); 2977 Throw* t = new(zone_) Throw(isolate_, exception, pos);
2971 VISIT_AND_RETURN(Throw, t) 2978 VISIT_AND_RETURN(Throw, t)
2972 } 2979 }
2973 2980
2974 FunctionLiteral* NewFunctionLiteral( 2981 FunctionLiteral* NewFunctionLiteral(
2975 Handle<String> name, 2982 Handle<String> name,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3016 private: 3023 private:
3017 Isolate* isolate_; 3024 Isolate* isolate_;
3018 Zone* zone_; 3025 Zone* zone_;
3019 Visitor visitor_; 3026 Visitor visitor_;
3020 }; 3027 };
3021 3028
3022 3029
3023 } } // namespace v8::internal 3030 } } // namespace v8::internal
3024 3031
3025 #endif // V8_AST_H_ 3032 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698