| OLD | NEW |
| 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 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2061 protected: | 2061 protected: |
| 2062 CompareOperation(Isolate* isolate, | 2062 CompareOperation(Isolate* isolate, |
| 2063 Token::Value op, | 2063 Token::Value op, |
| 2064 Expression* left, | 2064 Expression* left, |
| 2065 Expression* right, | 2065 Expression* right, |
| 2066 int pos) | 2066 int pos) |
| 2067 : Expression(isolate, pos), | 2067 : Expression(isolate, pos), |
| 2068 op_(op), | 2068 op_(op), |
| 2069 left_(left), | 2069 left_(left), |
| 2070 right_(right), | 2070 right_(right), |
| 2071 combined_type_(Type::None(), isolate) { | 2071 combined_type_(Type::None(isolate)) { |
| 2072 ASSERT(Token::IsCompareOp(op)); | 2072 ASSERT(Token::IsCompareOp(op)); |
| 2073 } | 2073 } |
| 2074 | 2074 |
| 2075 private: | 2075 private: |
| 2076 Token::Value op_; | 2076 Token::Value op_; |
| 2077 Expression* left_; | 2077 Expression* left_; |
| 2078 Expression* right_; | 2078 Expression* right_; |
| 2079 | 2079 |
| 2080 Handle<Type> combined_type_; | 2080 Handle<Type> combined_type_; |
| 2081 }; | 2081 }; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2289 LanguageMode language_mode() const; | 2289 LanguageMode language_mode() const; |
| 2290 | 2290 |
| 2291 int materialized_literal_count() { return materialized_literal_count_; } | 2291 int materialized_literal_count() { return materialized_literal_count_; } |
| 2292 int expected_property_count() { return expected_property_count_; } | 2292 int expected_property_count() { return expected_property_count_; } |
| 2293 int handler_count() { return handler_count_; } | 2293 int handler_count() { return handler_count_; } |
| 2294 int parameter_count() { return parameter_count_; } | 2294 int parameter_count() { return parameter_count_; } |
| 2295 | 2295 |
| 2296 bool AllowsLazyCompilation(); | 2296 bool AllowsLazyCompilation(); |
| 2297 bool AllowsLazyCompilationWithoutContext(); | 2297 bool AllowsLazyCompilationWithoutContext(); |
| 2298 | 2298 |
| 2299 void InitializeSharedInfo(Handle<Code> code); |
| 2300 |
| 2299 Handle<String> debug_name() const { | 2301 Handle<String> debug_name() const { |
| 2300 if (name_->length() > 0) return name_; | 2302 if (name_->length() > 0) return name_; |
| 2301 return inferred_name(); | 2303 return inferred_name(); |
| 2302 } | 2304 } |
| 2303 | 2305 |
| 2304 Handle<String> inferred_name() const { return inferred_name_; } | 2306 Handle<String> inferred_name() const { return inferred_name_; } |
| 2305 void set_inferred_name(Handle<String> inferred_name) { | 2307 void set_inferred_name(Handle<String> inferred_name) { |
| 2306 inferred_name_ = inferred_name; | 2308 inferred_name_ = inferred_name; |
| 2307 } | 2309 } |
| 2308 | 2310 |
| 2311 // shared_info may be null if it's not cached in full code. |
| 2312 Handle<SharedFunctionInfo> shared_info() { return shared_info_; } |
| 2313 |
| 2309 bool pretenure() { return Pretenure::decode(bitfield_); } | 2314 bool pretenure() { return Pretenure::decode(bitfield_); } |
| 2310 void set_pretenure() { bitfield_ |= Pretenure::encode(true); } | 2315 void set_pretenure() { bitfield_ |= Pretenure::encode(true); } |
| 2311 | 2316 |
| 2312 bool has_duplicate_parameters() { | 2317 bool has_duplicate_parameters() { |
| 2313 return HasDuplicateParameters::decode(bitfield_); | 2318 return HasDuplicateParameters::decode(bitfield_); |
| 2314 } | 2319 } |
| 2315 | 2320 |
| 2316 bool is_function() { return IsFunction::decode(bitfield_) == kIsFunction; } | 2321 bool is_function() { return IsFunction::decode(bitfield_) == kIsFunction; } |
| 2317 | 2322 |
| 2318 // This is used as a heuristic on when to eagerly compile a function | 2323 // This is used as a heuristic on when to eagerly compile a function |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2374 IsAnonymous::encode(function_type == ANONYMOUS_EXPRESSION) | | 2379 IsAnonymous::encode(function_type == ANONYMOUS_EXPRESSION) | |
| 2375 Pretenure::encode(false) | | 2380 Pretenure::encode(false) | |
| 2376 HasDuplicateParameters::encode(has_duplicate_parameters) | | 2381 HasDuplicateParameters::encode(has_duplicate_parameters) | |
| 2377 IsFunction::encode(is_function) | | 2382 IsFunction::encode(is_function) | |
| 2378 IsParenthesized::encode(is_parenthesized) | | 2383 IsParenthesized::encode(is_parenthesized) | |
| 2379 IsGenerator::encode(is_generator); | 2384 IsGenerator::encode(is_generator); |
| 2380 } | 2385 } |
| 2381 | 2386 |
| 2382 private: | 2387 private: |
| 2383 Handle<String> name_; | 2388 Handle<String> name_; |
| 2389 Handle<SharedFunctionInfo> shared_info_; |
| 2384 Scope* scope_; | 2390 Scope* scope_; |
| 2385 ZoneList<Statement*>* body_; | 2391 ZoneList<Statement*>* body_; |
| 2386 Handle<String> inferred_name_; | 2392 Handle<String> inferred_name_; |
| 2387 AstProperties ast_properties_; | 2393 AstProperties ast_properties_; |
| 2388 BailoutReason dont_optimize_reason_; | 2394 BailoutReason dont_optimize_reason_; |
| 2389 | 2395 |
| 2390 int materialized_literal_count_; | 2396 int materialized_literal_count_; |
| 2391 int expected_property_count_; | 2397 int expected_property_count_; |
| 2392 int handler_count_; | 2398 int handler_count_; |
| 2393 int parameter_count_; | 2399 int parameter_count_; |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3293 private: | 3299 private: |
| 3294 Isolate* isolate_; | 3300 Isolate* isolate_; |
| 3295 Zone* zone_; | 3301 Zone* zone_; |
| 3296 Visitor visitor_; | 3302 Visitor visitor_; |
| 3297 }; | 3303 }; |
| 3298 | 3304 |
| 3299 | 3305 |
| 3300 } } // namespace v8::internal | 3306 } } // namespace v8::internal |
| 3301 | 3307 |
| 3302 #endif // V8_AST_H_ | 3308 #endif // V8_AST_H_ |
| OLD | NEW |