OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 | 119 |
120 template <typename T> | 120 template <typename T> |
121 static inline v8::internal::Handle<v8::internal::Object> FromCData(T obj) { | 121 static inline v8::internal::Handle<v8::internal::Object> FromCData(T obj) { |
122 STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); | 122 STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); |
123 return v8::internal::Factory::NewProxy( | 123 return v8::internal::Factory::NewProxy( |
124 reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(obj))); | 124 reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(obj))); |
125 } | 125 } |
126 | 126 |
127 | 127 |
| 128 class ApiFunction { |
| 129 public: |
| 130 explicit ApiFunction(v8::internal::Address addr) : addr_(addr) { } |
| 131 v8::internal::Address address() { return addr_; } |
| 132 private: |
| 133 v8::internal::Address addr_; |
| 134 }; |
| 135 |
| 136 |
128 v8::Arguments::Arguments(v8::Local<v8::Value> data, | 137 v8::Arguments::Arguments(v8::Local<v8::Value> data, |
129 v8::Local<v8::Object> holder, | 138 v8::Local<v8::Object> holder, |
130 v8::Local<v8::Function> callee, | 139 v8::Local<v8::Function> callee, |
131 bool is_construct_call, | 140 bool is_construct_call, |
132 void** values, int length) | 141 void** values, int length) |
133 : data_(data), holder_(holder), callee_(callee), | 142 : data_(data), holder_(holder), callee_(callee), |
134 is_construct_call_(is_construct_call), | 143 is_construct_call_(is_construct_call), |
135 values_(values), length_(length) { } | 144 values_(values), length_(length) { } |
136 | 145 |
137 | 146 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 #ifdef DEBUG | 470 #ifdef DEBUG |
462 v8::ImplementationUtilities::ZapHandleRange( | 471 v8::ImplementationUtilities::ZapHandleRange( |
463 spare_, | 472 spare_, |
464 &spare_[kHandleBlockSize]); | 473 &spare_[kHandleBlockSize]); |
465 #endif | 474 #endif |
466 } | 475 } |
467 | 476 |
468 } } // namespace v8::internal | 477 } } // namespace v8::internal |
469 | 478 |
470 #endif // V8_API_H_ | 479 #endif // V8_API_H_ |
OLD | NEW |