Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: src/crankshaft/hydrogen.h

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

Powered by Google App Engine
This is Rietveld 408576698