OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2186 i::Handle<i::Object> hidden_props(i::GetHiddenProperties(self, false)); | 2186 i::Handle<i::Object> hidden_props(i::GetHiddenProperties(self, false)); |
2187 if (hidden_props->IsUndefined()) { | 2187 if (hidden_props->IsUndefined()) { |
2188 return true; | 2188 return true; |
2189 } | 2189 } |
2190 i::Handle<i::JSObject> js_obj(i::JSObject::cast(*hidden_props)); | 2190 i::Handle<i::JSObject> js_obj(i::JSObject::cast(*hidden_props)); |
2191 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 2191 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
2192 return i::DeleteProperty(js_obj, key_obj)->IsTrue(); | 2192 return i::DeleteProperty(js_obj, key_obj)->IsTrue(); |
2193 } | 2193 } |
2194 | 2194 |
2195 | 2195 |
| 2196 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { |
| 2197 ON_BAILOUT("v8::SetElementsToPixelData()", return); |
| 2198 ENTER_V8; |
| 2199 if (!ApiCheck(i::Smi::IsValid(length), |
| 2200 "v8::Object::SetIndexedPropertiesToPixelData()", |
| 2201 "length exceeds max acceptable value")) { |
| 2202 return; |
| 2203 } |
| 2204 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2205 if (!ApiCheck(!self->IsJSArray(), |
| 2206 "v8::Object::SetIndexedPropertiesToPixelData()", |
| 2207 "JSArray is not supported")) { |
| 2208 return; |
| 2209 } |
| 2210 i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length, data); |
| 2211 self->set_elements(*pixels); |
| 2212 } |
| 2213 |
| 2214 |
2196 Local<v8::Object> Function::NewInstance() const { | 2215 Local<v8::Object> Function::NewInstance() const { |
2197 return NewInstance(0, NULL); | 2216 return NewInstance(0, NULL); |
2198 } | 2217 } |
2199 | 2218 |
2200 | 2219 |
2201 Local<v8::Object> Function::NewInstance(int argc, | 2220 Local<v8::Object> Function::NewInstance(int argc, |
2202 v8::Handle<v8::Value> argv[]) const { | 2221 v8::Handle<v8::Value> argv[]) const { |
2203 ON_BAILOUT("v8::Function::NewInstance()", return Local<v8::Object>()); | 2222 ON_BAILOUT("v8::Function::NewInstance()", return Local<v8::Object>()); |
2204 LOG_API("Function::NewInstance"); | 2223 LOG_API("Function::NewInstance"); |
2205 ENTER_V8; | 2224 ENTER_V8; |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3049 } | 3068 } |
3050 } | 3069 } |
3051 | 3070 |
3052 | 3071 |
3053 Local<Object> Array::CloneElementAt(uint32_t index) { | 3072 Local<Object> Array::CloneElementAt(uint32_t index) { |
3054 ON_BAILOUT("v8::Array::CloneElementAt()", return Local<Object>()); | 3073 ON_BAILOUT("v8::Array::CloneElementAt()", return Local<Object>()); |
3055 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3074 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3056 if (!self->HasFastElements()) { | 3075 if (!self->HasFastElements()) { |
3057 return Local<Object>(); | 3076 return Local<Object>(); |
3058 } | 3077 } |
3059 i::FixedArray* elms = self->elements(); | 3078 i::FixedArray* elms = i::FixedArray::cast(self->elements()); |
3060 i::Object* paragon = elms->get(index); | 3079 i::Object* paragon = elms->get(index); |
3061 if (!paragon->IsJSObject()) { | 3080 if (!paragon->IsJSObject()) { |
3062 return Local<Object>(); | 3081 return Local<Object>(); |
3063 } | 3082 } |
3064 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon)); | 3083 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon)); |
3065 EXCEPTION_PREAMBLE(); | 3084 EXCEPTION_PREAMBLE(); |
3066 i::Handle<i::JSObject> result = i::Copy(paragon_handle); | 3085 i::Handle<i::JSObject> result = i::Copy(paragon_handle); |
3067 has_pending_exception = result.is_null(); | 3086 has_pending_exception = result.is_null(); |
3068 EXCEPTION_BAILOUT_CHECK(Local<Object>()); | 3087 EXCEPTION_BAILOUT_CHECK(Local<Object>()); |
3069 return Utils::ToLocal(result); | 3088 return Utils::ToLocal(result); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3563 reinterpret_cast<HandleScopeImplementer*>(storage); | 3582 reinterpret_cast<HandleScopeImplementer*>(storage); |
3564 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); | 3583 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); |
3565 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = | 3584 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = |
3566 &thread_local->handle_scope_data_; | 3585 &thread_local->handle_scope_data_; |
3567 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); | 3586 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); |
3568 | 3587 |
3569 return storage + ArchiveSpacePerThread(); | 3588 return storage + ArchiveSpacePerThread(); |
3570 } | 3589 } |
3571 | 3590 |
3572 } } // namespace v8::internal | 3591 } } // namespace v8::internal |
OLD | NEW |