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 | |
137 v8::Arguments::Arguments(v8::Local<v8::Value> data, | 128 v8::Arguments::Arguments(v8::Local<v8::Value> data, |
138 v8::Local<v8::Object> holder, | 129 v8::Local<v8::Object> holder, |
139 v8::Local<v8::Function> callee, | 130 v8::Local<v8::Function> callee, |
140 bool is_construct_call, | 131 bool is_construct_call, |
141 void** values, int length) | 132 void** values, int length) |
142 : data_(data), holder_(holder), callee_(callee), | 133 : data_(data), holder_(holder), callee_(callee), |
143 is_construct_call_(is_construct_call), | 134 is_construct_call_(is_construct_call), |
144 values_(values), length_(length) { } | 135 values_(values), length_(length) { } |
145 | 136 |
146 | 137 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 #ifdef DEBUG | 461 #ifdef DEBUG |
471 v8::ImplementationUtilities::ZapHandleRange( | 462 v8::ImplementationUtilities::ZapHandleRange( |
472 spare_, | 463 spare_, |
473 &spare_[kHandleBlockSize]); | 464 &spare_[kHandleBlockSize]); |
474 #endif | 465 #endif |
475 } | 466 } |
476 | 467 |
477 } } // namespace v8::internal | 468 } } // namespace v8::internal |
478 | 469 |
479 #endif // V8_API_H_ | 470 #endif // V8_API_H_ |
OLD | NEW |