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