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