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_HYDROGEN_H_ | 5 #ifndef V8_HYDROGEN_H_ |
6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1855 HValue* payload); | 1855 HValue* payload); |
1856 | 1856 |
1857 HInstruction* BuildConstantMapCheck(Handle<JSObject> constant); | 1857 HInstruction* BuildConstantMapCheck(Handle<JSObject> constant); |
1858 HInstruction* BuildCheckPrototypeMaps(Handle<JSObject> prototype, | 1858 HInstruction* BuildCheckPrototypeMaps(Handle<JSObject> prototype, |
1859 Handle<JSObject> holder); | 1859 Handle<JSObject> holder); |
1860 | 1860 |
1861 HInstruction* BuildGetNativeContext(HValue* closure); | 1861 HInstruction* BuildGetNativeContext(HValue* closure); |
1862 HInstruction* BuildGetNativeContext(); | 1862 HInstruction* BuildGetNativeContext(); |
1863 HInstruction* BuildGetScriptContext(int context_index); | 1863 HInstruction* BuildGetScriptContext(int context_index); |
1864 HInstruction* BuildGetArrayFunction(); | 1864 HInstruction* BuildGetArrayFunction(); |
1865 HValue* BuildArrayBufferViewFieldAccessor(HValue* object, | |
1866 HValue* checked_object, | |
1867 FieldIndex index); | |
1868 | |
1869 | 1865 |
1870 protected: | 1866 protected: |
1871 void SetSourcePosition(int position) { | 1867 void SetSourcePosition(int position) { |
1872 if (position != RelocInfo::kNoPosition) { | 1868 if (position != RelocInfo::kNoPosition) { |
1873 position_.set_position(position - start_position_); | 1869 position_.set_position(position - start_position_); |
1874 } | 1870 } |
1875 // Otherwise position remains unknown. | 1871 // Otherwise position remains unknown. |
1876 } | 1872 } |
1877 | 1873 |
1878 void EnterInlinedSource(int start_position, int id) { | 1874 void EnterInlinedSource(int start_position, int id) { |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); | 2547 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); |
2552 *access = HObjectAccess::ForArrayLength(map_->elements_kind()); | 2548 *access = HObjectAccess::ForArrayLength(map_->elements_kind()); |
2553 } else { | 2549 } else { |
2554 *access = HObjectAccess::ForMapAndOffset(map_, offset); | 2550 *access = HObjectAccess::ForMapAndOffset(map_, offset); |
2555 } | 2551 } |
2556 return true; | 2552 return true; |
2557 } | 2553 } |
2558 return false; | 2554 return false; |
2559 } | 2555 } |
2560 | 2556 |
2561 bool IsJSArrayBufferViewFieldAccessor() { | |
2562 int offset; // unused | |
2563 return Accessors::IsJSArrayBufferViewFieldAccessor(map_, name_, &offset); | |
2564 } | |
2565 | |
2566 bool GetJSArrayBufferViewFieldAccess(HObjectAccess* access) { | |
2567 int offset; | |
2568 if (Accessors::IsJSArrayBufferViewFieldAccessor(map_, name_, &offset)) { | |
2569 *access = HObjectAccess::ForMapAndOffset(map_, offset); | |
2570 return true; | |
2571 } | |
2572 return false; | |
2573 } | |
2574 | |
2575 bool has_holder() { return !holder_.is_null(); } | 2557 bool has_holder() { return !holder_.is_null(); } |
2576 bool IsLoad() const { return access_type_ == LOAD; } | 2558 bool IsLoad() const { return access_type_ == LOAD; } |
2577 | 2559 |
2578 Isolate* isolate() const { return builder_->isolate(); } | 2560 Isolate* isolate() const { return builder_->isolate(); } |
2579 Handle<JSObject> holder() { return holder_; } | 2561 Handle<JSObject> holder() { return holder_; } |
2580 Handle<JSFunction> accessor() { return accessor_; } | 2562 Handle<JSFunction> accessor() { return accessor_; } |
2581 Handle<Object> constant() { return constant_; } | 2563 Handle<Object> constant() { return constant_; } |
2582 Handle<Map> transition() { return transition_; } | 2564 Handle<Map> transition() { return transition_; } |
2583 SmallMapList* field_maps() { return &field_maps_; } | 2565 SmallMapList* field_maps() { return &field_maps_; } |
2584 HType field_type() const { return field_type_; } | 2566 HType field_type() const { return field_type_; } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2689 SmallMapList field_maps_; | 2671 SmallMapList field_maps_; |
2690 HType field_type_; | 2672 HType field_type_; |
2691 HObjectAccess access_; | 2673 HObjectAccess access_; |
2692 | 2674 |
2693 enum { NOT_FOUND, DESCRIPTOR_TYPE, TRANSITION_TYPE } lookup_type_; | 2675 enum { NOT_FOUND, DESCRIPTOR_TYPE, TRANSITION_TYPE } lookup_type_; |
2694 Handle<Map> transition_; | 2676 Handle<Map> transition_; |
2695 int number_; | 2677 int number_; |
2696 PropertyDetails details_; | 2678 PropertyDetails details_; |
2697 }; | 2679 }; |
2698 | 2680 |
2699 HValue* BuildMonomorphicAccess(PropertyAccessInfo* info, HValue* object, | 2681 HInstruction* BuildMonomorphicAccess(PropertyAccessInfo* info, |
2700 HValue* checked_object, HValue* value, | 2682 HValue* object, |
2701 BailoutId ast_id, BailoutId return_id, | 2683 HValue* checked_object, |
2702 bool can_inline_accessor = true); | 2684 HValue* value, |
| 2685 BailoutId ast_id, |
| 2686 BailoutId return_id, |
| 2687 bool can_inline_accessor = true); |
2703 | 2688 |
2704 HValue* BuildNamedAccess(PropertyAccessType access, BailoutId ast_id, | 2689 HInstruction* BuildNamedAccess(PropertyAccessType access, |
2705 BailoutId reutrn_id, Expression* expr, | 2690 BailoutId ast_id, |
2706 HValue* object, Handle<String> name, HValue* value, | 2691 BailoutId reutrn_id, |
2707 bool is_uninitialized = false); | 2692 Expression* expr, |
| 2693 HValue* object, |
| 2694 Handle<String> name, |
| 2695 HValue* value, |
| 2696 bool is_uninitialized = false); |
2708 | 2697 |
2709 void HandlePolymorphicCallNamed(Call* expr, | 2698 void HandlePolymorphicCallNamed(Call* expr, |
2710 HValue* receiver, | 2699 HValue* receiver, |
2711 SmallMapList* types, | 2700 SmallMapList* types, |
2712 Handle<String> name); | 2701 Handle<String> name); |
2713 void HandleLiteralCompareTypeof(CompareOperation* expr, | 2702 void HandleLiteralCompareTypeof(CompareOperation* expr, |
2714 Expression* sub_expr, | 2703 Expression* sub_expr, |
2715 Handle<String> check); | 2704 Handle<String> check); |
2716 void HandleLiteralCompareNil(CompareOperation* expr, | 2705 void HandleLiteralCompareNil(CompareOperation* expr, |
2717 Expression* sub_expr, | 2706 Expression* sub_expr, |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3047 } | 3036 } |
3048 | 3037 |
3049 private: | 3038 private: |
3050 HGraphBuilder* builder_; | 3039 HGraphBuilder* builder_; |
3051 }; | 3040 }; |
3052 | 3041 |
3053 | 3042 |
3054 } } // namespace v8::internal | 3043 } } // namespace v8::internal |
3055 | 3044 |
3056 #endif // V8_HYDROGEN_H_ | 3045 #endif // V8_HYDROGEN_H_ |
OLD | NEW |