OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "hydrogen.h" | 5 #include "hydrogen.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "v8.h" | 9 #include "v8.h" |
10 #include "allocation-site-scopes.h" | 10 #include "allocation-site-scopes.h" |
(...skipping 8722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8733 HObjectAccess::ForJSArrayBufferViewWeakNext(), | 8733 HObjectAccess::ForJSArrayBufferViewWeakNext(), |
8734 graph()->GetConstantUndefined()); | 8734 graph()->GetConstantUndefined()); |
8735 } | 8735 } |
8736 } | 8736 } |
8737 | 8737 |
8738 | 8738 |
8739 void HOptimizedGraphBuilder::GenerateDataViewInitialize( | 8739 void HOptimizedGraphBuilder::GenerateDataViewInitialize( |
8740 CallRuntime* expr) { | 8740 CallRuntime* expr) { |
8741 ZoneList<Expression*>* arguments = expr->arguments(); | 8741 ZoneList<Expression*>* arguments = expr->arguments(); |
8742 | 8742 |
8743 NoObservableSideEffectsScope scope(this); | |
8744 ASSERT(arguments->length()== 4); | 8743 ASSERT(arguments->length()== 4); |
8745 CHECK_ALIVE(VisitForValue(arguments->at(0))); | 8744 CHECK_ALIVE(VisitForValue(arguments->at(0))); |
8746 HValue* obj = Pop(); | 8745 HValue* obj = Pop(); |
8747 | 8746 |
8748 CHECK_ALIVE(VisitForValue(arguments->at(1))); | 8747 CHECK_ALIVE(VisitForValue(arguments->at(1))); |
8749 HValue* buffer = Pop(); | 8748 HValue* buffer = Pop(); |
8750 | 8749 |
8751 CHECK_ALIVE(VisitForValue(arguments->at(2))); | 8750 CHECK_ALIVE(VisitForValue(arguments->at(2))); |
8752 HValue* byte_offset = Pop(); | 8751 HValue* byte_offset = Pop(); |
8753 | 8752 |
8754 CHECK_ALIVE(VisitForValue(arguments->at(3))); | 8753 CHECK_ALIVE(VisitForValue(arguments->at(3))); |
8755 HValue* byte_length = Pop(); | 8754 HValue* byte_length = Pop(); |
8756 | 8755 |
8757 BuildArrayBufferViewInitialization<JSDataView>( | 8756 { |
8758 obj, buffer, byte_offset, byte_length); | 8757 NoObservableSideEffectsScope scope(this); |
| 8758 BuildArrayBufferViewInitialization<JSDataView>( |
| 8759 obj, buffer, byte_offset, byte_length); |
| 8760 } |
8759 } | 8761 } |
8760 | 8762 |
8761 | 8763 |
8762 static Handle<Map> TypedArrayMap(Isolate* isolate, | 8764 static Handle<Map> TypedArrayMap(Isolate* isolate, |
8763 ExternalArrayType array_type, | 8765 ExternalArrayType array_type, |
8764 ElementsKind target_kind) { | 8766 ElementsKind target_kind) { |
8765 Handle<Context> native_context = isolate->native_context(); | 8767 Handle<Context> native_context = isolate->native_context(); |
8766 Handle<JSFunction> fun; | 8768 Handle<JSFunction> fun; |
8767 switch (array_type) { | 8769 switch (array_type) { |
8768 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 8770 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8869 builder.EndBody(); | 8871 builder.EndBody(); |
8870 } | 8872 } |
8871 return elements; | 8873 return elements; |
8872 } | 8874 } |
8873 | 8875 |
8874 | 8876 |
8875 void HOptimizedGraphBuilder::GenerateTypedArrayInitialize( | 8877 void HOptimizedGraphBuilder::GenerateTypedArrayInitialize( |
8876 CallRuntime* expr) { | 8878 CallRuntime* expr) { |
8877 ZoneList<Expression*>* arguments = expr->arguments(); | 8879 ZoneList<Expression*>* arguments = expr->arguments(); |
8878 | 8880 |
8879 NoObservableSideEffectsScope scope(this); | |
8880 static const int kObjectArg = 0; | 8881 static const int kObjectArg = 0; |
8881 static const int kArrayIdArg = 1; | 8882 static const int kArrayIdArg = 1; |
8882 static const int kBufferArg = 2; | 8883 static const int kBufferArg = 2; |
8883 static const int kByteOffsetArg = 3; | 8884 static const int kByteOffsetArg = 3; |
8884 static const int kByteLengthArg = 4; | 8885 static const int kByteLengthArg = 4; |
8885 static const int kArgsLength = 5; | 8886 static const int kArgsLength = 5; |
8886 ASSERT(arguments->length() == kArgsLength); | 8887 ASSERT(arguments->length() == kArgsLength); |
8887 | 8888 |
8888 | 8889 |
8889 CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); | 8890 CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8924 } else { | 8925 } else { |
8925 CHECK_ALIVE(VisitForValue(arguments->at(kByteOffsetArg))); | 8926 CHECK_ALIVE(VisitForValue(arguments->at(kByteOffsetArg))); |
8926 byte_offset = Pop(); | 8927 byte_offset = Pop(); |
8927 is_zero_byte_offset = false; | 8928 is_zero_byte_offset = false; |
8928 ASSERT(buffer != NULL); | 8929 ASSERT(buffer != NULL); |
8929 } | 8930 } |
8930 | 8931 |
8931 CHECK_ALIVE(VisitForValue(arguments->at(kByteLengthArg))); | 8932 CHECK_ALIVE(VisitForValue(arguments->at(kByteLengthArg))); |
8932 HValue* byte_length = Pop(); | 8933 HValue* byte_length = Pop(); |
8933 | 8934 |
| 8935 NoObservableSideEffectsScope scope(this); |
8934 IfBuilder byte_offset_smi(this); | 8936 IfBuilder byte_offset_smi(this); |
8935 | 8937 |
8936 if (!is_zero_byte_offset) { | 8938 if (!is_zero_byte_offset) { |
8937 byte_offset_smi.If<HIsSmiAndBranch>(byte_offset); | 8939 byte_offset_smi.If<HIsSmiAndBranch>(byte_offset); |
8938 byte_offset_smi.Then(); | 8940 byte_offset_smi.Then(); |
8939 } | 8941 } |
8940 | 8942 |
8941 ExternalArrayType array_type = | 8943 ExternalArrayType array_type = |
8942 kExternalInt8Array; // Bogus initialization. | 8944 kExternalInt8Array; // Bogus initialization. |
8943 size_t element_size = 1; // Bogus initialization. | 8945 size_t element_size = 1; // Bogus initialization. |
(...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11795 if (ShouldProduceTraceOutput()) { | 11797 if (ShouldProduceTraceOutput()) { |
11796 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11798 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11797 } | 11799 } |
11798 | 11800 |
11799 #ifdef DEBUG | 11801 #ifdef DEBUG |
11800 graph_->Verify(false); // No full verify. | 11802 graph_->Verify(false); // No full verify. |
11801 #endif | 11803 #endif |
11802 } | 11804 } |
11803 | 11805 |
11804 } } // namespace v8::internal | 11806 } } // namespace v8::internal |
OLD | NEW |