OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 void NeanderObject::set(int offset, v8::internal::Object* value) { | 109 void NeanderObject::set(int offset, v8::internal::Object* value) { |
110 ASSERT(value_->HasFastElements()); | 110 ASSERT(value_->HasFastElements()); |
111 v8::internal::FixedArray::cast(value_->elements())->set(offset, value); | 111 v8::internal::FixedArray::cast(value_->elements())->set(offset, value); |
112 } | 112 } |
113 | 113 |
114 | 114 |
115 template <typename T> static inline T ToCData(v8::internal::Object* obj) { | 115 template <typename T> static inline T ToCData(v8::internal::Object* obj) { |
116 STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); | 116 STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); |
117 return reinterpret_cast<T>( | 117 return reinterpret_cast<T>( |
118 reinterpret_cast<intptr_t>(v8::internal::Foreign::cast(obj)->address())); | 118 reinterpret_cast<intptr_t>( |
| 119 v8::internal::Foreign::cast(obj)->foreign_address())); |
119 } | 120 } |
120 | 121 |
121 | 122 |
122 template <typename T> | 123 template <typename T> |
123 static inline v8::internal::Handle<v8::internal::Object> FromCData(T obj) { | 124 static inline v8::internal::Handle<v8::internal::Object> FromCData(T obj) { |
124 STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); | 125 STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); |
125 return FACTORY->NewForeign( | 126 return FACTORY->NewForeign( |
126 reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(obj))); | 127 reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(obj))); |
127 } | 128 } |
128 | 129 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 stress_type_ = stress_type; | 562 stress_type_ = stress_type; |
562 } | 563 } |
563 | 564 |
564 private: | 565 private: |
565 static v8::Testing::StressType stress_type_; | 566 static v8::Testing::StressType stress_type_; |
566 }; | 567 }; |
567 | 568 |
568 } } // namespace v8::internal | 569 } } // namespace v8::internal |
569 | 570 |
570 #endif // V8_API_H_ | 571 #endif // V8_API_H_ |
OLD | NEW |