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