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 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 void PushArgumentsFromEnvironment(int count); | 2333 void PushArgumentsFromEnvironment(int count); |
2334 | 2334 |
2335 void SetUpScope(DeclarationScope* scope); | 2335 void SetUpScope(DeclarationScope* scope); |
2336 void VisitStatements(ZoneList<Statement*>* statements); | 2336 void VisitStatements(ZoneList<Statement*>* statements); |
2337 | 2337 |
2338 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 2338 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
2339 AST_NODE_LIST(DECLARE_VISIT) | 2339 AST_NODE_LIST(DECLARE_VISIT) |
2340 #undef DECLARE_VISIT | 2340 #undef DECLARE_VISIT |
2341 | 2341 |
2342 private: | 2342 private: |
2343 bool CanInlineGlobalPropertyAccess(Variable* var, LookupIterator* it, | 2343 // Helpers for flow graph construction. |
2344 PropertyAccessType access_type); | 2344 enum GlobalPropertyAccess { |
2345 | 2345 kUseCell, |
2346 bool CanInlineGlobalPropertyAccess(LookupIterator* it, | 2346 kUseGeneric |
2347 PropertyAccessType access_type); | 2347 }; |
2348 | 2348 GlobalPropertyAccess LookupGlobalProperty(Variable* var, LookupIterator* it, |
2349 void InlineGlobalPropertyLoad(LookupIterator* it, BailoutId ast_id); | 2349 PropertyAccessType access_type); |
2350 HInstruction* InlineGlobalPropertyStore(LookupIterator* it, HValue* value, | |
2351 BailoutId ast_id); | |
2352 | 2350 |
2353 void EnsureArgumentsArePushedForAccess(); | 2351 void EnsureArgumentsArePushedForAccess(); |
2354 bool TryArgumentsAccess(Property* expr); | 2352 bool TryArgumentsAccess(Property* expr); |
2355 | 2353 |
2356 // Shared code for .call and .apply optimizations. | 2354 // Shared code for .call and .apply optimizations. |
2357 void HandleIndirectCall(Call* expr, HValue* function, int arguments_count); | 2355 void HandleIndirectCall(Call* expr, HValue* function, int arguments_count); |
2358 // Try to optimize indirect calls such as fun.apply(receiver, arguments) | 2356 // Try to optimize indirect calls such as fun.apply(receiver, arguments) |
2359 // or fun.call(...). | 2357 // or fun.call(...). |
2360 bool TryIndirectCall(Call* expr); | 2358 bool TryIndirectCall(Call* expr); |
2361 void BuildFunctionApply(Call* expr); | 2359 void BuildFunctionApply(Call* expr); |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 } | 3013 } |
3016 | 3014 |
3017 private: | 3015 private: |
3018 HOptimizedGraphBuilder* builder_; | 3016 HOptimizedGraphBuilder* builder_; |
3019 }; | 3017 }; |
3020 | 3018 |
3021 } // namespace internal | 3019 } // namespace internal |
3022 } // namespace v8 | 3020 } // namespace v8 |
3023 | 3021 |
3024 #endif // V8_CRANKSHAFT_HYDROGEN_H_ | 3022 #endif // V8_CRANKSHAFT_HYDROGEN_H_ |
OLD | NEW |