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