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.h" | 10 #include "src/ast/ast.h" |
(...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2420 HValue* ImplicitReceiverFor(HValue* function, | 2420 HValue* ImplicitReceiverFor(HValue* function, |
2421 Handle<JSFunction> target); | 2421 Handle<JSFunction> target); |
2422 | 2422 |
2423 int InliningAstSize(Handle<JSFunction> target); | 2423 int InliningAstSize(Handle<JSFunction> target); |
2424 bool TryInline(Handle<JSFunction> target, int arguments_count, | 2424 bool TryInline(Handle<JSFunction> target, int arguments_count, |
2425 HValue* implicit_return_value, BailoutId ast_id, | 2425 HValue* implicit_return_value, BailoutId ast_id, |
2426 BailoutId return_id, InliningKind inlining_kind); | 2426 BailoutId return_id, InliningKind inlining_kind); |
2427 | 2427 |
2428 bool TryInlineCall(Call* expr); | 2428 bool TryInlineCall(Call* expr); |
2429 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); | 2429 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); |
2430 bool TryInlineGetter(Handle<JSFunction> getter, | 2430 bool TryInlineGetter(Handle<Object> getter, Handle<Map> receiver_map, |
2431 Handle<Map> receiver_map, | 2431 BailoutId ast_id, BailoutId return_id); |
2432 BailoutId ast_id, | 2432 bool TryInlineSetter(Handle<Object> setter, Handle<Map> receiver_map, |
2433 BailoutId return_id); | 2433 BailoutId id, BailoutId assignment_id, |
2434 bool TryInlineSetter(Handle<JSFunction> setter, | |
2435 Handle<Map> receiver_map, | |
2436 BailoutId id, | |
2437 BailoutId assignment_id, | |
2438 HValue* implicit_return_value); | 2434 HValue* implicit_return_value); |
2439 bool TryInlineIndirectCall(Handle<JSFunction> function, Call* expr, | 2435 bool TryInlineIndirectCall(Handle<JSFunction> function, Call* expr, |
2440 int arguments_count); | 2436 int arguments_count); |
2441 bool TryInlineBuiltinMethodCall(Call* expr, Handle<JSFunction> function, | 2437 bool TryInlineBuiltinMethodCall(Call* expr, Handle<JSFunction> function, |
2442 Handle<Map> receiver_map, | 2438 Handle<Map> receiver_map, |
2443 int args_count_no_receiver); | 2439 int args_count_no_receiver); |
2444 bool TryInlineBuiltinFunctionCall(Call* expr); | 2440 bool TryInlineBuiltinFunctionCall(Call* expr); |
2445 enum ApiCallType { | 2441 enum ApiCallType { |
2446 kCallApiFunction, | 2442 kCallApiFunction, |
2447 kCallApiMethod, | 2443 kCallApiMethod, |
2448 kCallApiGetter, | 2444 kCallApiGetter, |
2449 kCallApiSetter | 2445 kCallApiSetter |
2450 }; | 2446 }; |
2451 bool TryInlineApiMethodCall(Call* expr, | 2447 bool TryInlineApiMethodCall(Call* expr, |
2452 HValue* receiver, | 2448 HValue* receiver, |
2453 SmallMapList* receiver_types); | 2449 SmallMapList* receiver_types); |
2454 bool TryInlineApiFunctionCall(Call* expr, HValue* receiver); | 2450 bool TryInlineApiFunctionCall(Call* expr, HValue* receiver); |
2455 bool TryInlineApiGetter(Handle<JSFunction> function, | 2451 bool TryInlineApiGetter(Handle<Object> function, Handle<Map> receiver_map, |
2456 Handle<Map> receiver_map, | |
2457 BailoutId ast_id); | 2452 BailoutId ast_id); |
2458 bool TryInlineApiSetter(Handle<JSFunction> function, | 2453 bool TryInlineApiSetter(Handle<Object> function, Handle<Map> receiver_map, |
2459 Handle<Map> receiver_map, | |
2460 BailoutId ast_id); | 2454 BailoutId ast_id); |
2461 bool TryInlineApiCall(Handle<JSFunction> function, | 2455 bool TryInlineApiCall(Handle<Object> function, HValue* receiver, |
2462 HValue* receiver, | 2456 SmallMapList* receiver_maps, int argc, BailoutId ast_id, |
2463 SmallMapList* receiver_maps, | 2457 ApiCallType call_type); |
2464 int argc, | |
2465 BailoutId ast_id, | |
2466 ApiCallType call_type); | |
2467 static bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map); | 2458 static bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map); |
2468 static bool CanInlineArrayResizeOperation(Handle<Map> receiver_map); | 2459 static bool CanInlineArrayResizeOperation(Handle<Map> receiver_map); |
2469 | 2460 |
2470 // If --trace-inlining, print a line of the inlining trace. Inlining | 2461 // If --trace-inlining, print a line of the inlining trace. Inlining |
2471 // succeeded if the reason string is NULL and failed if there is a | 2462 // succeeded if the reason string is NULL and failed if there is a |
2472 // non-NULL reason string. | 2463 // non-NULL reason string. |
2473 void TraceInline(Handle<JSFunction> target, | 2464 void TraceInline(Handle<JSFunction> target, |
2474 Handle<JSFunction> caller, | 2465 Handle<JSFunction> caller, |
2475 const char* failure_reason); | 2466 const char* failure_reason); |
2476 | 2467 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 return true; | 2590 return true; |
2600 } | 2591 } |
2601 return false; | 2592 return false; |
2602 } | 2593 } |
2603 | 2594 |
2604 bool has_holder() { return !holder_.is_null(); } | 2595 bool has_holder() { return !holder_.is_null(); } |
2605 bool IsLoad() const { return access_type_ == LOAD; } | 2596 bool IsLoad() const { return access_type_ == LOAD; } |
2606 | 2597 |
2607 Isolate* isolate() const { return builder_->isolate(); } | 2598 Isolate* isolate() const { return builder_->isolate(); } |
2608 Handle<JSObject> holder() { return holder_; } | 2599 Handle<JSObject> holder() { return holder_; } |
2609 Handle<JSFunction> accessor() { return accessor_; } | 2600 Handle<Object> accessor() { return accessor_; } |
2610 Handle<Object> constant() { return constant_; } | 2601 Handle<Object> constant() { return constant_; } |
2611 Handle<Map> transition() { return transition_; } | 2602 Handle<Map> transition() { return transition_; } |
2612 SmallMapList* field_maps() { return &field_maps_; } | 2603 SmallMapList* field_maps() { return &field_maps_; } |
2613 HType field_type() const { return field_type_; } | 2604 HType field_type() const { return field_type_; } |
2614 HObjectAccess access() { return access_; } | 2605 HObjectAccess access() { return access_; } |
2615 | 2606 |
2616 bool IsFound() const { return lookup_type_ != NOT_FOUND; } | 2607 bool IsFound() const { return lookup_type_ != NOT_FOUND; } |
2617 bool IsProperty() const { return IsFound() && !IsTransition(); } | 2608 bool IsProperty() const { return IsFound() && !IsTransition(); } |
2618 bool IsTransition() const { return lookup_type_ == TRANSITION_TYPE; } | 2609 bool IsTransition() const { return lookup_type_ == TRANSITION_TYPE; } |
2619 bool IsData() const { | 2610 bool IsData() const { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2705 void GeneralizeRepresentation(Representation r) { | 2696 void GeneralizeRepresentation(Representation r) { |
2706 access_ = access_.WithRepresentation( | 2697 access_ = access_.WithRepresentation( |
2707 access_.representation().generalize(r)); | 2698 access_.representation().generalize(r)); |
2708 } | 2699 } |
2709 | 2700 |
2710 HOptimizedGraphBuilder* builder_; | 2701 HOptimizedGraphBuilder* builder_; |
2711 PropertyAccessType access_type_; | 2702 PropertyAccessType access_type_; |
2712 Handle<Map> map_; | 2703 Handle<Map> map_; |
2713 Handle<Name> name_; | 2704 Handle<Name> name_; |
2714 Handle<JSObject> holder_; | 2705 Handle<JSObject> holder_; |
2715 Handle<JSFunction> accessor_; | 2706 Handle<Object> accessor_; |
2716 Handle<JSObject> api_holder_; | 2707 Handle<JSObject> api_holder_; |
2717 Handle<Object> constant_; | 2708 Handle<Object> constant_; |
2718 SmallMapList field_maps_; | 2709 SmallMapList field_maps_; |
2719 HType field_type_; | 2710 HType field_type_; |
2720 HObjectAccess access_; | 2711 HObjectAccess access_; |
2721 | 2712 |
2722 enum { NOT_FOUND, DESCRIPTOR_TYPE, TRANSITION_TYPE } lookup_type_; | 2713 enum { NOT_FOUND, DESCRIPTOR_TYPE, TRANSITION_TYPE } lookup_type_; |
2723 Handle<Map> transition_; | 2714 Handle<Map> transition_; |
2724 int number_; | 2715 int number_; |
2725 PropertyDetails details_; | 2716 PropertyDetails details_; |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3063 | 3054 |
3064 private: | 3055 private: |
3065 HGraphBuilder* builder_; | 3056 HGraphBuilder* builder_; |
3066 }; | 3057 }; |
3067 | 3058 |
3068 | 3059 |
3069 } // namespace internal | 3060 } // namespace internal |
3070 } // namespace v8 | 3061 } // namespace v8 |
3071 | 3062 |
3072 #endif // V8_CRANKSHAFT_HYDROGEN_H_ | 3063 #endif // V8_CRANKSHAFT_HYDROGEN_H_ |
OLD | NEW |