Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: include/v8.h

Issue 1149563011: Verify a bit more about external strings (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 private: 2421 private:
2422 uint16_t* str_; 2422 uint16_t* str_;
2423 int length_; 2423 int length_;
2424 2424
2425 // Disallow copying and assigning. 2425 // Disallow copying and assigning.
2426 Value(const Value&); 2426 Value(const Value&);
2427 void operator=(const Value&); 2427 void operator=(const Value&);
2428 }; 2428 };
2429 2429
2430 private: 2430 private:
2431 void VerifyExternalStringResourceBase(ExternalStringResourceBase* v, 2431 friend class internal::Heap;
2432 void VerifyExternalStringResourceBase(const ExternalStringResourceBase* v,
2432 Encoding encoding) const; 2433 Encoding encoding) const;
2433 void VerifyExternalStringResource(ExternalStringResource* val) const;
2434 static void CheckCast(v8::Value* obj); 2434 static void CheckCast(v8::Value* obj);
2435 }; 2435 };
2436 2436
2437 2437
2438 /** 2438 /**
2439 * A JavaScript symbol (ECMA-262 edition 6) 2439 * A JavaScript symbol (ECMA-262 edition 6)
2440 * 2440 *
2441 * This is an experimental feature. Use at your own risk. 2441 * This is an experimental feature. Use at your own risk.
2442 */ 2442 */
2443 class V8_EXPORT Symbol : public Name { 2443 class V8_EXPORT Symbol : public Name {
(...skipping 5180 matching lines...) Expand 10 before | Expand all | Expand 10 after
7624 typedef internal::Internals I; 7624 typedef internal::Internals I;
7625 O* obj = *reinterpret_cast<O* const*>(this); 7625 O* obj = *reinterpret_cast<O* const*>(this);
7626 String::ExternalStringResource* result; 7626 String::ExternalStringResource* result;
7627 if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) { 7627 if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) {
7628 void* value = I::ReadField<void*>(obj, I::kStringResourceOffset); 7628 void* value = I::ReadField<void*>(obj, I::kStringResourceOffset);
7629 result = reinterpret_cast<String::ExternalStringResource*>(value); 7629 result = reinterpret_cast<String::ExternalStringResource*>(value);
7630 } else { 7630 } else {
7631 result = NULL; 7631 result = NULL;
7632 } 7632 }
7633 #ifdef V8_ENABLE_CHECKS 7633 #ifdef V8_ENABLE_CHECKS
7634 VerifyExternalStringResource(result); 7634 VerifyExternalStringResourceBase(result, TWO_BYTE_ENCODING);
7635 #endif 7635 #endif
7636 return result; 7636 return result;
7637 } 7637 }
7638 7638
7639 7639
7640 String::ExternalStringResourceBase* String::GetExternalStringResourceBase( 7640 String::ExternalStringResourceBase* String::GetExternalStringResourceBase(
7641 String::Encoding* encoding_out) const { 7641 String::Encoding* encoding_out) const {
7642 typedef internal::Object O; 7642 typedef internal::Object O;
7643 typedef internal::Internals I; 7643 typedef internal::Internals I;
7644 O* obj = *reinterpret_cast<O* const*>(this); 7644 O* obj = *reinterpret_cast<O* const*>(this);
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
8325 */ 8325 */
8326 8326
8327 8327
8328 } // namespace v8 8328 } // namespace v8
8329 8329
8330 8330
8331 #undef TYPE_CHECK 8331 #undef TYPE_CHECK
8332 8332
8333 8333
8334 #endif // V8_H_ 8334 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698