| 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 8871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8882 static const int kBufferArg = 2; | 8882 static const int kBufferArg = 2; |
| 8883 static const int kByteOffsetArg = 3; | 8883 static const int kByteOffsetArg = 3; |
| 8884 static const int kByteLengthArg = 4; | 8884 static const int kByteLengthArg = 4; |
| 8885 static const int kArgsLength = 5; | 8885 static const int kArgsLength = 5; |
| 8886 ASSERT(arguments->length() == kArgsLength); | 8886 ASSERT(arguments->length() == kArgsLength); |
| 8887 | 8887 |
| 8888 | 8888 |
| 8889 CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); | 8889 CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); |
| 8890 HValue* obj = Pop(); | 8890 HValue* obj = Pop(); |
| 8891 | 8891 |
| 8892 ASSERT(arguments->at(kArrayIdArg)->node_type() == AstNode::kLiteral); | 8892 if (arguments->at(kArrayIdArg)->node_type() != AstNode::kLiteral) { |
| 8893 // This should never happen in real use, but can happen when fuzzing. |
| 8894 // Just bail out. |
| 8895 Bailout(kNeedSmiLiteral); |
| 8896 return; |
| 8897 } |
| 8893 Handle<Object> value = | 8898 Handle<Object> value = |
| 8894 static_cast<Literal*>(arguments->at(kArrayIdArg))->value(); | 8899 static_cast<Literal*>(arguments->at(kArrayIdArg))->value(); |
| 8895 ASSERT(value->IsSmi()); | 8900 if (!value->IsSmi()) { |
| 8901 // This should never happen in real use, but can happen when fuzzing. |
| 8902 // Just bail out. |
| 8903 Bailout(kNeedSmiLiteral); |
| 8904 return; |
| 8905 } |
| 8896 int array_id = Smi::cast(*value)->value(); | 8906 int array_id = Smi::cast(*value)->value(); |
| 8897 | 8907 |
| 8898 HValue* buffer; | 8908 HValue* buffer; |
| 8899 if (!arguments->at(kBufferArg)->IsNullLiteral()) { | 8909 if (!arguments->at(kBufferArg)->IsNullLiteral()) { |
| 8900 CHECK_ALIVE(VisitForValue(arguments->at(kBufferArg))); | 8910 CHECK_ALIVE(VisitForValue(arguments->at(kBufferArg))); |
| 8901 buffer = Pop(); | 8911 buffer = Pop(); |
| 8902 } else { | 8912 } else { |
| 8903 buffer = NULL; | 8913 buffer = NULL; |
| 8904 } | 8914 } |
| 8905 | 8915 |
| (...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11797 if (ShouldProduceTraceOutput()) { | 11807 if (ShouldProduceTraceOutput()) { |
| 11798 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11808 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11799 } | 11809 } |
| 11800 | 11810 |
| 11801 #ifdef DEBUG | 11811 #ifdef DEBUG |
| 11802 graph_->Verify(false); // No full verify. | 11812 graph_->Verify(false); // No full verify. |
| 11803 #endif | 11813 #endif |
| 11804 } | 11814 } |
| 11805 | 11815 |
| 11806 } } // namespace v8::internal | 11816 } } // namespace v8::internal |
| OLD | NEW |