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

Side by Side Diff: src/ast.h

Issue 967243002: Polish Maybe API a bit, removing useless creativity and fixing some signatures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Simplified friendship. Added check in FromJust. Created 5 years, 9 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
« include/v8.h ('K') | « src/api.cc ('k') | src/contexts.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 2066
2067 // The short-circuit logical operations need an AST ID for their 2067 // The short-circuit logical operations need an AST ID for their
2068 // right-hand subexpression. 2068 // right-hand subexpression.
2069 static int num_ids() { return parent_num_ids() + 2; } 2069 static int num_ids() { return parent_num_ids() + 2; }
2070 BailoutId RightId() const { return BailoutId(local_id(0)); } 2070 BailoutId RightId() const { return BailoutId(local_id(0)); }
2071 2071
2072 TypeFeedbackId BinaryOperationFeedbackId() const { 2072 TypeFeedbackId BinaryOperationFeedbackId() const {
2073 return TypeFeedbackId(local_id(1)); 2073 return TypeFeedbackId(local_id(1));
2074 } 2074 }
2075 Maybe<int> fixed_right_arg() const { 2075 Maybe<int> fixed_right_arg() const {
2076 return has_fixed_right_arg_ ? Maybe<int>(fixed_right_arg_value_) 2076 return has_fixed_right_arg_ ? Just(fixed_right_arg_value_) : Nothing<int>();
2077 : Maybe<int>();
2078 } 2077 }
2079 void set_fixed_right_arg(Maybe<int> arg) { 2078 void set_fixed_right_arg(Maybe<int> arg) {
2080 has_fixed_right_arg_ = arg.has_value; 2079 has_fixed_right_arg_ = arg.has_value;
2081 if (arg.has_value) fixed_right_arg_value_ = arg.value; 2080 if (arg.has_value) fixed_right_arg_value_ = arg.value;
2082 } 2081 }
2083 2082
2084 virtual void RecordToBooleanTypeFeedback( 2083 virtual void RecordToBooleanTypeFeedback(
2085 TypeFeedbackOracle* oracle) OVERRIDE; 2084 TypeFeedbackOracle* oracle) OVERRIDE;
2086 2085
2087 protected: 2086 protected:
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
3510 3509
3511 private: 3510 private:
3512 Zone* zone_; 3511 Zone* zone_;
3513 AstValueFactory* ast_value_factory_; 3512 AstValueFactory* ast_value_factory_;
3514 }; 3513 };
3515 3514
3516 3515
3517 } } // namespace v8::internal 3516 } } // namespace v8::internal
3518 3517
3519 #endif // V8_AST_H_ 3518 #endif // V8_AST_H_
OLDNEW
« include/v8.h ('K') | « src/api.cc ('k') | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698