| 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 9131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9142 static const int kBufferArg = 2; | 9142 static const int kBufferArg = 2; |
| 9143 static const int kByteOffsetArg = 3; | 9143 static const int kByteOffsetArg = 3; |
| 9144 static const int kByteLengthArg = 4; | 9144 static const int kByteLengthArg = 4; |
| 9145 static const int kArgsLength = 5; | 9145 static const int kArgsLength = 5; |
| 9146 ASSERT(arguments->length() == kArgsLength); | 9146 ASSERT(arguments->length() == kArgsLength); |
| 9147 | 9147 |
| 9148 | 9148 |
| 9149 CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); | 9149 CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); |
| 9150 HValue* obj = Pop(); | 9150 HValue* obj = Pop(); |
| 9151 | 9151 |
| 9152 if (arguments->at(kArrayIdArg)->node_type() != AstNode::kLiteral) { | 9152 if (arguments->at(kArrayIdArg)->IsLiteral()) { |
| 9153 // This should never happen in real use, but can happen when fuzzing. | 9153 // This should never happen in real use, but can happen when fuzzing. |
| 9154 // Just bail out. | 9154 // Just bail out. |
| 9155 Bailout(kNeedSmiLiteral); | 9155 Bailout(kNeedSmiLiteral); |
| 9156 return; | 9156 return; |
| 9157 } | 9157 } |
| 9158 Handle<Object> value = | 9158 Handle<Object> value = |
| 9159 static_cast<Literal*>(arguments->at(kArrayIdArg))->value(); | 9159 static_cast<Literal*>(arguments->at(kArrayIdArg))->value(); |
| 9160 if (!value->IsSmi()) { | 9160 if (!value->IsSmi()) { |
| 9161 // This should never happen in real use, but can happen when fuzzing. | 9161 // This should never happen in real use, but can happen when fuzzing. |
| 9162 // Just bail out. | 9162 // Just bail out. |
| 9163 Bailout(kNeedSmiLiteral); | 9163 Bailout(kNeedSmiLiteral); |
| 9164 return; | 9164 return; |
| 9165 } | 9165 } |
| 9166 int array_id = Smi::cast(*value)->value(); | 9166 int array_id = Smi::cast(*value)->value(); |
| 9167 | 9167 |
| 9168 HValue* buffer; | 9168 HValue* buffer; |
| 9169 if (!arguments->at(kBufferArg)->IsNullLiteral()) { | 9169 if (!arguments->at(kBufferArg)->IsNullLiteral()) { |
| 9170 CHECK_ALIVE(VisitForValue(arguments->at(kBufferArg))); | 9170 CHECK_ALIVE(VisitForValue(arguments->at(kBufferArg))); |
| 9171 buffer = Pop(); | 9171 buffer = Pop(); |
| 9172 } else { | 9172 } else { |
| 9173 buffer = NULL; | 9173 buffer = NULL; |
| 9174 } | 9174 } |
| 9175 | 9175 |
| 9176 HValue* byte_offset; | 9176 HValue* byte_offset; |
| 9177 bool is_zero_byte_offset; | 9177 bool is_zero_byte_offset; |
| 9178 | 9178 |
| 9179 if (arguments->at(kByteOffsetArg)->node_type() == AstNode::kLiteral | 9179 if (arguments->at(kByteOffsetArg)->IsLiteral() |
| 9180 && Smi::FromInt(0) == | 9180 && Smi::FromInt(0) == |
| 9181 *static_cast<Literal*>(arguments->at(kByteOffsetArg))->value()) { | 9181 *static_cast<Literal*>(arguments->at(kByteOffsetArg))->value()) { |
| 9182 byte_offset = Add<HConstant>(static_cast<int32_t>(0)); | 9182 byte_offset = Add<HConstant>(static_cast<int32_t>(0)); |
| 9183 is_zero_byte_offset = true; | 9183 is_zero_byte_offset = true; |
| 9184 } else { | 9184 } else { |
| 9185 CHECK_ALIVE(VisitForValue(arguments->at(kByteOffsetArg))); | 9185 CHECK_ALIVE(VisitForValue(arguments->at(kByteOffsetArg))); |
| 9186 byte_offset = Pop(); | 9186 byte_offset = Pop(); |
| 9187 is_zero_byte_offset = false; | 9187 is_zero_byte_offset = false; |
| 9188 ASSERT(buffer != NULL); | 9188 ASSERT(buffer != NULL); |
| 9189 } | 9189 } |
| (...skipping 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12055 if (ShouldProduceTraceOutput()) { | 12055 if (ShouldProduceTraceOutput()) { |
| 12056 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12056 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12057 } | 12057 } |
| 12058 | 12058 |
| 12059 #ifdef DEBUG | 12059 #ifdef DEBUG |
| 12060 graph_->Verify(false); // No full verify. | 12060 graph_->Verify(false); // No full verify. |
| 12061 #endif | 12061 #endif |
| 12062 } | 12062 } |
| 12063 | 12063 |
| 12064 } } // namespace v8::internal | 12064 } } // namespace v8::internal |
| OLD | NEW |