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

Side by Side Diff: src/api.h

Issue 240113010: Tighten OpenHandle's extra checks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/accessors.cc ('k') | src/objects.h » ('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 // 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 V(Uint32Array, JSTypedArray) \ 179 V(Uint32Array, JSTypedArray) \
180 V(Int32Array, JSTypedArray) \ 180 V(Int32Array, JSTypedArray) \
181 V(Float32Array, JSTypedArray) \ 181 V(Float32Array, JSTypedArray) \
182 V(Float64Array, JSTypedArray) \ 182 V(Float64Array, JSTypedArray) \
183 V(DataView, JSDataView) \ 183 V(DataView, JSDataView) \
184 V(String, String) \ 184 V(String, String) \
185 V(Symbol, Symbol) \ 185 V(Symbol, Symbol) \
186 V(Script, JSFunction) \ 186 V(Script, JSFunction) \
187 V(UnboundScript, SharedFunctionInfo) \ 187 V(UnboundScript, SharedFunctionInfo) \
188 V(Function, JSFunction) \ 188 V(Function, JSFunction) \
189 V(Message, JSObject) \ 189 V(Message, JSMessageObject) \
190 V(Context, Context) \ 190 V(Context, Context) \
191 V(External, Foreign) \ 191 V(External, Object) \
192 V(StackTrace, JSArray) \ 192 V(StackTrace, JSArray) \
193 V(StackFrame, JSObject) \ 193 V(StackFrame, JSObject) \
194 V(DeclaredAccessorDescriptor, DeclaredAccessorDescriptor) 194 V(DeclaredAccessorDescriptor, DeclaredAccessorDescriptor)
195 195
196 196
197 class Utils { 197 class Utils {
198 public: 198 public:
199 static inline bool ApiCheck(bool condition, 199 static inline bool ApiCheck(bool condition,
200 const char* location, 200 const char* location,
201 const char* message) { 201 const char* message) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 #undef MAKE_TO_LOCAL 386 #undef MAKE_TO_LOCAL
387 387
388 388
389 // Implementations of OpenHandle 389 // Implementations of OpenHandle
390 390
391 #define MAKE_OPEN_HANDLE(From, To) \ 391 #define MAKE_OPEN_HANDLE(From, To) \
392 v8::internal::Handle<v8::internal::To> Utils::OpenHandle( \ 392 v8::internal::Handle<v8::internal::To> Utils::OpenHandle( \
393 const v8::From* that, bool allow_empty_handle) { \ 393 const v8::From* that, bool allow_empty_handle) { \
394 EXTRA_CHECK(allow_empty_handle || that != NULL); \ 394 EXTRA_CHECK(allow_empty_handle || that != NULL); \
395 EXTRA_CHECK(that == NULL || \ 395 EXTRA_CHECK(that == NULL || \
396 !(*reinterpret_cast<v8::internal::To**>( \ 396 (*reinterpret_cast<v8::internal::Object**>( \
397 const_cast<v8::From*>(that)))->IsFailure()); \ 397 const_cast<v8::From*>(that)))->Is##To()); \
398 return v8::internal::Handle<v8::internal::To>( \ 398 return v8::internal::Handle<v8::internal::To>( \
399 reinterpret_cast<v8::internal::To**>(const_cast<v8::From*>(that))); \ 399 reinterpret_cast<v8::internal::To**>(const_cast<v8::From*>(that))); \
400 } 400 }
401 401
402 OPEN_HANDLE_LIST(MAKE_OPEN_HANDLE) 402 OPEN_HANDLE_LIST(MAKE_OPEN_HANDLE)
403 403
404 #undef MAKE_OPEN_HANDLE 404 #undef MAKE_OPEN_HANDLE
405 #undef OPEN_HANDLE_LIST 405 #undef OPEN_HANDLE_LIST
406 406
407 407
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 stress_type_ = stress_type; 709 stress_type_ = stress_type;
710 } 710 }
711 711
712 private: 712 private:
713 static v8::Testing::StressType stress_type_; 713 static v8::Testing::StressType stress_type_;
714 }; 714 };
715 715
716 } } // namespace v8::internal 716 } } // namespace v8::internal
717 717
718 #endif // V8_API_H_ 718 #endif // V8_API_H_
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698