OLD | NEW |
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_CRANKSHAFT_HYDROGEN_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_H_ |
6 #define V8_CRANKSHAFT_HYDROGEN_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_H_ |
7 | 7 |
8 #include "src/accessors.h" | 8 #include "src/accessors.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/ast/ast-type-bounds.h" | 10 #include "src/ast/ast-type-bounds.h" |
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2353 void PushArgumentsFromEnvironment(int count); | 2353 void PushArgumentsFromEnvironment(int count); |
2354 | 2354 |
2355 void SetUpScope(DeclarationScope* scope); | 2355 void SetUpScope(DeclarationScope* scope); |
2356 void VisitStatements(ZoneList<Statement*>* statements); | 2356 void VisitStatements(ZoneList<Statement*>* statements); |
2357 | 2357 |
2358 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 2358 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
2359 AST_NODE_LIST(DECLARE_VISIT) | 2359 AST_NODE_LIST(DECLARE_VISIT) |
2360 #undef DECLARE_VISIT | 2360 #undef DECLARE_VISIT |
2361 | 2361 |
2362 private: | 2362 private: |
2363 // Helpers for flow graph construction. | 2363 bool CanInlineGlobalPropertyAccess(Variable* var, LookupIterator* it, |
2364 enum GlobalPropertyAccess { | 2364 PropertyAccessType access_type); |
2365 kUseCell, | 2365 |
2366 kUseGeneric | 2366 bool CanInlineGlobalPropertyAccess(LookupIterator* it, |
2367 }; | 2367 PropertyAccessType access_type); |
2368 GlobalPropertyAccess LookupGlobalProperty(Variable* var, LookupIterator* it, | 2368 |
2369 PropertyAccessType access_type); | 2369 void InlineGlobalPropertyLoad(LookupIterator* it, BailoutId ast_id); |
| 2370 void InlineGlobalPropertyStore(LookupIterator* it, HValue* value, |
| 2371 BailoutId ast_id); |
2370 | 2372 |
2371 void EnsureArgumentsArePushedForAccess(); | 2373 void EnsureArgumentsArePushedForAccess(); |
2372 bool TryArgumentsAccess(Property* expr); | 2374 bool TryArgumentsAccess(Property* expr); |
2373 | 2375 |
2374 // Shared code for .call and .apply optimizations. | 2376 // Shared code for .call and .apply optimizations. |
2375 void HandleIndirectCall(Call* expr, HValue* function, int arguments_count); | 2377 void HandleIndirectCall(Call* expr, HValue* function, int arguments_count); |
2376 // Try to optimize indirect calls such as fun.apply(receiver, arguments) | 2378 // Try to optimize indirect calls such as fun.apply(receiver, arguments) |
2377 // or fun.call(...). | 2379 // or fun.call(...). |
2378 bool TryIndirectCall(Call* expr); | 2380 bool TryIndirectCall(Call* expr); |
2379 void BuildFunctionApply(Call* expr); | 2381 void BuildFunctionApply(Call* expr); |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3033 } | 3035 } |
3034 | 3036 |
3035 private: | 3037 private: |
3036 HOptimizedGraphBuilder* builder_; | 3038 HOptimizedGraphBuilder* builder_; |
3037 }; | 3039 }; |
3038 | 3040 |
3039 } // namespace internal | 3041 } // namespace internal |
3040 } // namespace v8 | 3042 } // namespace v8 |
3041 | 3043 |
3042 #endif // V8_CRANKSHAFT_HYDROGEN_H_ | 3044 #endif // V8_CRANKSHAFT_HYDROGEN_H_ |
OLD | NEW |