| 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 2283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2294 LanguageMode language_mode() const; | 2294 LanguageMode language_mode() const; |
| 2295 | 2295 |
| 2296 int materialized_literal_count() { return materialized_literal_count_; } | 2296 int materialized_literal_count() { return materialized_literal_count_; } |
| 2297 int expected_property_count() { return expected_property_count_; } | 2297 int expected_property_count() { return expected_property_count_; } |
| 2298 int handler_count() { return handler_count_; } | 2298 int handler_count() { return handler_count_; } |
| 2299 int parameter_count() { return parameter_count_; } | 2299 int parameter_count() { return parameter_count_; } |
| 2300 | 2300 |
| 2301 bool AllowsLazyCompilation(); | 2301 bool AllowsLazyCompilation(); |
| 2302 bool AllowsLazyCompilationWithoutContext(); | 2302 bool AllowsLazyCompilationWithoutContext(); |
| 2303 | 2303 |
| 2304 void InitializeSharedInfo(Handle<Code> code); |
| 2305 |
| 2304 Handle<String> debug_name() const { | 2306 Handle<String> debug_name() const { |
| 2305 if (name_->length() > 0) return name_; | 2307 if (name_->length() > 0) return name_; |
| 2306 return inferred_name(); | 2308 return inferred_name(); |
| 2307 } | 2309 } |
| 2308 | 2310 |
| 2309 Handle<String> inferred_name() const { return inferred_name_; } | 2311 Handle<String> inferred_name() const { return inferred_name_; } |
| 2310 void set_inferred_name(Handle<String> inferred_name) { | 2312 void set_inferred_name(Handle<String> inferred_name) { |
| 2311 inferred_name_ = inferred_name; | 2313 inferred_name_ = inferred_name; |
| 2312 } | 2314 } |
| 2313 | 2315 |
| 2316 // shared_info may be null if it's not cached in full code. |
| 2317 Handle<SharedFunctionInfo> shared_info() { return shared_info_; } |
| 2318 |
| 2314 bool pretenure() { return Pretenure::decode(bitfield_); } | 2319 bool pretenure() { return Pretenure::decode(bitfield_); } |
| 2315 void set_pretenure() { bitfield_ |= Pretenure::encode(true); } | 2320 void set_pretenure() { bitfield_ |= Pretenure::encode(true); } |
| 2316 | 2321 |
| 2317 bool has_duplicate_parameters() { | 2322 bool has_duplicate_parameters() { |
| 2318 return HasDuplicateParameters::decode(bitfield_); | 2323 return HasDuplicateParameters::decode(bitfield_); |
| 2319 } | 2324 } |
| 2320 | 2325 |
| 2321 bool is_function() { return IsFunction::decode(bitfield_) == kIsFunction; } | 2326 bool is_function() { return IsFunction::decode(bitfield_) == kIsFunction; } |
| 2322 | 2327 |
| 2323 // This is used as a heuristic on when to eagerly compile a function | 2328 // 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... |
| 2379 IsAnonymous::encode(function_type == ANONYMOUS_EXPRESSION) | | 2384 IsAnonymous::encode(function_type == ANONYMOUS_EXPRESSION) | |
| 2380 Pretenure::encode(false) | | 2385 Pretenure::encode(false) | |
| 2381 HasDuplicateParameters::encode(has_duplicate_parameters) | | 2386 HasDuplicateParameters::encode(has_duplicate_parameters) | |
| 2382 IsFunction::encode(is_function) | | 2387 IsFunction::encode(is_function) | |
| 2383 IsParenthesized::encode(is_parenthesized) | | 2388 IsParenthesized::encode(is_parenthesized) | |
| 2384 IsGenerator::encode(is_generator); | 2389 IsGenerator::encode(is_generator); |
| 2385 } | 2390 } |
| 2386 | 2391 |
| 2387 private: | 2392 private: |
| 2388 Handle<String> name_; | 2393 Handle<String> name_; |
| 2394 Handle<SharedFunctionInfo> shared_info_; |
| 2389 Scope* scope_; | 2395 Scope* scope_; |
| 2390 ZoneList<Statement*>* body_; | 2396 ZoneList<Statement*>* body_; |
| 2391 Handle<String> inferred_name_; | 2397 Handle<String> inferred_name_; |
| 2392 AstProperties ast_properties_; | 2398 AstProperties ast_properties_; |
| 2393 BailoutReason dont_optimize_reason_; | 2399 BailoutReason dont_optimize_reason_; |
| 2394 | 2400 |
| 2395 int materialized_literal_count_; | 2401 int materialized_literal_count_; |
| 2396 int expected_property_count_; | 2402 int expected_property_count_; |
| 2397 int handler_count_; | 2403 int handler_count_; |
| 2398 int parameter_count_; | 2404 int parameter_count_; |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3298 private: | 3304 private: |
| 3299 Isolate* isolate_; | 3305 Isolate* isolate_; |
| 3300 Zone* zone_; | 3306 Zone* zone_; |
| 3301 Visitor visitor_; | 3307 Visitor visitor_; |
| 3302 }; | 3308 }; |
| 3303 | 3309 |
| 3304 | 3310 |
| 3305 } } // namespace v8::internal | 3311 } } // namespace v8::internal |
| 3306 | 3312 |
| 3307 #endif // V8_AST_H_ | 3313 #endif // V8_AST_H_ |
| OLD | NEW |