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 "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 10263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10274 HInstruction* HOptimizedGraphBuilder::BuildStringCharCodeAt( | 10274 HInstruction* HOptimizedGraphBuilder::BuildStringCharCodeAt( |
10275 HValue* string, | 10275 HValue* string, |
10276 HValue* index) { | 10276 HValue* index) { |
10277 if (string->IsConstant() && index->IsConstant()) { | 10277 if (string->IsConstant() && index->IsConstant()) { |
10278 HConstant* c_string = HConstant::cast(string); | 10278 HConstant* c_string = HConstant::cast(string); |
10279 HConstant* c_index = HConstant::cast(index); | 10279 HConstant* c_index = HConstant::cast(index); |
10280 if (c_string->HasStringValue() && c_index->HasNumberValue()) { | 10280 if (c_string->HasStringValue() && c_index->HasNumberValue()) { |
10281 int32_t i = c_index->NumberValueAsInteger32(); | 10281 int32_t i = c_index->NumberValueAsInteger32(); |
10282 Handle<String> s = c_string->StringValue(); | 10282 Handle<String> s = c_string->StringValue(); |
10283 if (i < 0 || i >= s->length()) { | 10283 if (i < 0 || i >= s->length()) { |
10284 return New<HConstant>(base::OS::nan_value()); | 10284 return New<HConstant>(std::numeric_limits<double>::quiet_NaN()); |
10285 } | 10285 } |
10286 return New<HConstant>(s->Get(i)); | 10286 return New<HConstant>(s->Get(i)); |
10287 } | 10287 } |
10288 } | 10288 } |
10289 string = BuildCheckString(string); | 10289 string = BuildCheckString(string); |
10290 index = Add<HBoundsCheck>(index, AddLoadStringLength(string)); | 10290 index = Add<HBoundsCheck>(index, AddLoadStringLength(string)); |
10291 return New<HStringCharCodeAt>(string, index); | 10291 return New<HStringCharCodeAt>(string, index); |
10292 } | 10292 } |
10293 | 10293 |
10294 | 10294 |
(...skipping 3168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13463 if (ShouldProduceTraceOutput()) { | 13463 if (ShouldProduceTraceOutput()) { |
13464 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13464 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13465 } | 13465 } |
13466 | 13466 |
13467 #ifdef DEBUG | 13467 #ifdef DEBUG |
13468 graph_->Verify(false); // No full verify. | 13468 graph_->Verify(false); // No full verify. |
13469 #endif | 13469 #endif |
13470 } | 13470 } |
13471 | 13471 |
13472 } } // namespace v8::internal | 13472 } } // namespace v8::internal |
OLD | NEW |