OLD | NEW |
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 87 matching lines...) Loading... |
98 NeanderObject::NeanderObject(v8::internal::Object* obj) | 98 NeanderObject::NeanderObject(v8::internal::Object* obj) |
99 : value_(v8::internal::Handle<v8::internal::JSObject>( | 99 : value_(v8::internal::Handle<v8::internal::JSObject>( |
100 v8::internal::JSObject::cast(obj))) { } | 100 v8::internal::JSObject::cast(obj))) { } |
101 | 101 |
102 | 102 |
103 NeanderArray::NeanderArray(v8::internal::Handle<v8::internal::Object> obj) | 103 NeanderArray::NeanderArray(v8::internal::Handle<v8::internal::Object> obj) |
104 : obj_(obj) { } | 104 : obj_(obj) { } |
105 | 105 |
106 | 106 |
107 v8::internal::Object* NeanderObject::get(int offset) { | 107 v8::internal::Object* NeanderObject::get(int offset) { |
108 ASSERT(value()->HasFastElements()); | 108 ASSERT(value()->HasFastObjectElements()); |
109 return v8::internal::FixedArray::cast(value()->elements())->get(offset); | 109 return v8::internal::FixedArray::cast(value()->elements())->get(offset); |
110 } | 110 } |
111 | 111 |
112 | 112 |
113 void NeanderObject::set(int offset, v8::internal::Object* value) { | 113 void NeanderObject::set(int offset, v8::internal::Object* value) { |
114 ASSERT(value_->HasFastElements()); | 114 ASSERT(value_->HasFastObjectElements()); |
115 v8::internal::FixedArray::cast(value_->elements())->set(offset, value); | 115 v8::internal::FixedArray::cast(value_->elements())->set(offset, value); |
116 } | 116 } |
117 | 117 |
118 | 118 |
119 template <typename T> inline T ToCData(v8::internal::Object* obj) { | 119 template <typename T> inline T ToCData(v8::internal::Object* obj) { |
120 STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); | 120 STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address)); |
121 return reinterpret_cast<T>( | 121 return reinterpret_cast<T>( |
122 reinterpret_cast<intptr_t>( | 122 reinterpret_cast<intptr_t>( |
123 v8::internal::Foreign::cast(obj)->foreign_address())); | 123 v8::internal::Foreign::cast(obj)->foreign_address())); |
124 } | 124 } |
(...skipping 435 matching lines...) Loading... |
560 stress_type_ = stress_type; | 560 stress_type_ = stress_type; |
561 } | 561 } |
562 | 562 |
563 private: | 563 private: |
564 static v8::Testing::StressType stress_type_; | 564 static v8::Testing::StressType stress_type_; |
565 }; | 565 }; |
566 | 566 |
567 } } // namespace v8::internal | 567 } } // namespace v8::internal |
568 | 568 |
569 #endif // V8_API_H_ | 569 #endif // V8_API_H_ |
OLD | NEW |