| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4054 if (IsDeadCheck(str->GetIsolate(), "v8::String::Length()")) return 0; | 4054 if (IsDeadCheck(str->GetIsolate(), "v8::String::Length()")) return 0; |
| 4055 return str->length(); | 4055 return str->length(); |
| 4056 } | 4056 } |
| 4057 | 4057 |
| 4058 | 4058 |
| 4059 bool String::IsOneByte() const { | 4059 bool String::IsOneByte() const { |
| 4060 i::Handle<i::String> str = Utils::OpenHandle(this); | 4060 i::Handle<i::String> str = Utils::OpenHandle(this); |
| 4061 if (IsDeadCheck(str->GetIsolate(), "v8::String::IsOneByte()")) { | 4061 if (IsDeadCheck(str->GetIsolate(), "v8::String::IsOneByte()")) { |
| 4062 return false; | 4062 return false; |
| 4063 } | 4063 } |
| 4064 return str->IsOneByteConvertible(); | 4064 return str->HasOnlyOneByteChars(); |
| 4065 } | 4065 } |
| 4066 | 4066 |
| 4067 | 4067 |
| 4068 class Utf8LengthHelper : public i::AllStatic { | 4068 class Utf8LengthHelper : public i::AllStatic { |
| 4069 public: | 4069 public: |
| 4070 enum State { | 4070 enum State { |
| 4071 kEndsWithLeadingSurrogate = 1 << 0, | 4071 kEndsWithLeadingSurrogate = 1 << 0, |
| 4072 kStartsWithTrailingSurrogate = 1 << 1, | 4072 kStartsWithTrailingSurrogate = 1 << 1, |
| 4073 kLeftmostEdgeIsCalculated = 1 << 2, | 4073 kLeftmostEdgeIsCalculated = 1 << 2, |
| 4074 kRightmostEdgeIsCalculated = 1 << 3, | 4074 kRightmostEdgeIsCalculated = 1 << 3, |
| (...skipping 3404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7479 | 7479 |
| 7480 v->VisitPointers(blocks_.first(), first_block_limit_); | 7480 v->VisitPointers(blocks_.first(), first_block_limit_); |
| 7481 | 7481 |
| 7482 for (int i = 1; i < blocks_.length(); i++) { | 7482 for (int i = 1; i < blocks_.length(); i++) { |
| 7483 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7483 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
| 7484 } | 7484 } |
| 7485 } | 7485 } |
| 7486 | 7486 |
| 7487 | 7487 |
| 7488 } } // namespace v8::internal | 7488 } } // namespace v8::internal |
| OLD | NEW |