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