| 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 3051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3062 | 3062 |
| 3063 | 3063 |
| 3064 bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) { | 3064 bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) { |
| 3065 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3065 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3066 ON_BAILOUT(isolate, "v8::Object::Set()", return false); | 3066 ON_BAILOUT(isolate, "v8::Object::Set()", return false); |
| 3067 ENTER_V8(isolate); | 3067 ENTER_V8(isolate); |
| 3068 i::HandleScope scope(isolate); | 3068 i::HandleScope scope(isolate); |
| 3069 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3069 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 3070 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 3070 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
| 3071 EXCEPTION_PREAMBLE(isolate); | 3071 EXCEPTION_PREAMBLE(isolate); |
| 3072 i::Handle<i::Object> obj = i::JSObject::SetElement( | 3072 has_pending_exception = i::JSObject::SetElement( |
| 3073 self, | 3073 self, index, value_obj, NONE, i::SLOPPY).is_null(); |
| 3074 index, | |
| 3075 value_obj, | |
| 3076 NONE, | |
| 3077 i::SLOPPY); | |
| 3078 has_pending_exception = obj.is_null(); | |
| 3079 EXCEPTION_BAILOUT_CHECK(isolate, false); | 3074 EXCEPTION_BAILOUT_CHECK(isolate, false); |
| 3080 return true; | 3075 return true; |
| 3081 } | 3076 } |
| 3082 | 3077 |
| 3083 | 3078 |
| 3084 bool v8::Object::ForceSet(v8::Handle<Value> key, | 3079 bool v8::Object::ForceSet(v8::Handle<Value> key, |
| 3085 v8::Handle<Value> value, | 3080 v8::Handle<Value> value, |
| 3086 v8::PropertyAttribute attribs) { | 3081 v8::PropertyAttribute attribs) { |
| 3087 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3082 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3088 ON_BAILOUT(isolate, "v8::Object::ForceSet()", return false); | 3083 ON_BAILOUT(isolate, "v8::Object::ForceSet()", return false); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 3118 | 3113 |
| 3119 // When deleting a property on the global object using ForceDelete | 3114 // When deleting a property on the global object using ForceDelete |
| 3120 // deoptimize all functions as optimized code does not check for the hole | 3115 // deoptimize all functions as optimized code does not check for the hole |
| 3121 // value with DontDelete properties. We have to deoptimize all contexts | 3116 // value with DontDelete properties. We have to deoptimize all contexts |
| 3122 // because of possible cross-context inlined functions. | 3117 // because of possible cross-context inlined functions. |
| 3123 if (self->IsJSGlobalProxy() || self->IsGlobalObject()) { | 3118 if (self->IsJSGlobalProxy() || self->IsGlobalObject()) { |
| 3124 i::Deoptimizer::DeoptimizeAll(isolate); | 3119 i::Deoptimizer::DeoptimizeAll(isolate); |
| 3125 } | 3120 } |
| 3126 | 3121 |
| 3127 EXCEPTION_PREAMBLE(isolate); | 3122 EXCEPTION_PREAMBLE(isolate); |
| 3128 i::Handle<i::Object> obj = i::ForceDeleteProperty(self, key_obj); | 3123 i::Handle<i::Object> obj; |
| 3129 has_pending_exception = obj.is_null(); | 3124 has_pending_exception = !i::Runtime::DeleteObjectProperty( |
| 3125 isolate, self, key_obj, i::JSReceiver::FORCE_DELETION).ToHandle(&obj); |
| 3130 EXCEPTION_BAILOUT_CHECK(isolate, false); | 3126 EXCEPTION_BAILOUT_CHECK(isolate, false); |
| 3131 return obj->IsTrue(); | 3127 return obj->IsTrue(); |
| 3132 } | 3128 } |
| 3133 | 3129 |
| 3134 | 3130 |
| 3135 Local<Value> v8::Object::Get(v8::Handle<Value> key) { | 3131 Local<Value> v8::Object::Get(v8::Handle<Value> key) { |
| 3136 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3132 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3137 ON_BAILOUT(isolate, "v8::Object::Get()", return Local<v8::Value>()); | 3133 ON_BAILOUT(isolate, "v8::Object::Get()", return Local<v8::Value>()); |
| 3138 ENTER_V8(isolate); | 3134 ENTER_V8(isolate); |
| 3139 i::Handle<i::Object> self = Utils::OpenHandle(this); | 3135 i::Handle<i::Object> self = Utils::OpenHandle(this); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3351 | 3347 |
| 3352 | 3348 |
| 3353 bool v8::Object::Delete(v8::Handle<Value> key) { | 3349 bool v8::Object::Delete(v8::Handle<Value> key) { |
| 3354 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3350 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3355 ON_BAILOUT(isolate, "v8::Object::Delete()", return false); | 3351 ON_BAILOUT(isolate, "v8::Object::Delete()", return false); |
| 3356 ENTER_V8(isolate); | 3352 ENTER_V8(isolate); |
| 3357 i::HandleScope scope(isolate); | 3353 i::HandleScope scope(isolate); |
| 3358 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3354 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 3359 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); | 3355 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); |
| 3360 EXCEPTION_PREAMBLE(isolate); | 3356 EXCEPTION_PREAMBLE(isolate); |
| 3361 i::Handle<i::Object> obj = i::DeleteProperty(self, key_obj); | 3357 i::Handle<i::Object> obj; |
| 3362 has_pending_exception = obj.is_null(); | 3358 has_pending_exception = !i::Runtime::DeleteObjectProperty( |
| 3359 isolate, self, key_obj, i::JSReceiver::NORMAL_DELETION).ToHandle(&obj); |
| 3363 EXCEPTION_BAILOUT_CHECK(isolate, false); | 3360 EXCEPTION_BAILOUT_CHECK(isolate, false); |
| 3364 return obj->IsTrue(); | 3361 return obj->IsTrue(); |
| 3365 } | 3362 } |
| 3366 | 3363 |
| 3367 | 3364 |
| 3368 bool v8::Object::DeletePrivate(v8::Handle<Private> key) { | 3365 bool v8::Object::DeletePrivate(v8::Handle<Private> key) { |
| 3369 return Delete(v8::Handle<Value>(reinterpret_cast<Value*>(*key))); | 3366 return Delete(v8::Handle<Value>(reinterpret_cast<Value*>(*key))); |
| 3370 } | 3367 } |
| 3371 | 3368 |
| 3372 | 3369 |
| 3373 bool v8::Object::Has(v8::Handle<Value> key) { | 3370 bool v8::Object::Has(v8::Handle<Value> key) { |
| 3374 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3371 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3375 ON_BAILOUT(isolate, "v8::Object::Has()", return false); | 3372 ON_BAILOUT(isolate, "v8::Object::Has()", return false); |
| 3376 ENTER_V8(isolate); | 3373 ENTER_V8(isolate); |
| 3377 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); | 3374 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); |
| 3378 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); | 3375 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); |
| 3379 EXCEPTION_PREAMBLE(isolate); | 3376 EXCEPTION_PREAMBLE(isolate); |
| 3380 i::Handle<i::Object> obj = i::HasProperty(self, key_obj); | 3377 i::Handle<i::Object> obj; |
| 3381 has_pending_exception = obj.is_null(); | 3378 has_pending_exception = !i::Runtime::HasObjectProperty( |
| 3379 isolate, self, key_obj).ToHandle(&obj); |
| 3382 EXCEPTION_BAILOUT_CHECK(isolate, false); | 3380 EXCEPTION_BAILOUT_CHECK(isolate, false); |
| 3383 return obj->IsTrue(); | 3381 return obj->IsTrue(); |
| 3384 } | 3382 } |
| 3385 | 3383 |
| 3386 | 3384 |
| 3387 bool v8::Object::HasPrivate(v8::Handle<Private> key) { | 3385 bool v8::Object::HasPrivate(v8::Handle<Private> key) { |
| 3388 return Has(v8::Handle<Value>(reinterpret_cast<Value*>(*key))); | 3386 return Has(v8::Handle<Value>(reinterpret_cast<Value*>(*key))); |
| 3389 } | 3387 } |
| 3390 | 3388 |
| 3391 | 3389 |
| 3392 bool v8::Object::Delete(uint32_t index) { | 3390 bool v8::Object::Delete(uint32_t index) { |
| 3393 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3391 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3394 ON_BAILOUT(isolate, "v8::Object::DeleteProperty()", | 3392 ON_BAILOUT(isolate, "v8::Object::DeleteProperty()", |
| 3395 return false); | 3393 return false); |
| 3396 ENTER_V8(isolate); | 3394 ENTER_V8(isolate); |
| 3397 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 3395 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
| 3398 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3396 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 3399 return i::JSReceiver::DeleteElement(self, index)->IsTrue(); | 3397 |
| 3398 EXCEPTION_PREAMBLE(isolate); |
| 3399 i::Handle<i::Object> obj; |
| 3400 has_pending_exception = |
| 3401 !i::JSReceiver::DeleteElement(self, index).ToHandle(&obj); |
| 3402 EXCEPTION_BAILOUT_CHECK(isolate, false); |
| 3403 return obj->IsTrue(); |
| 3400 } | 3404 } |
| 3401 | 3405 |
| 3402 | 3406 |
| 3403 bool v8::Object::Has(uint32_t index) { | 3407 bool v8::Object::Has(uint32_t index) { |
| 3404 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3408 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3405 ON_BAILOUT(isolate, "v8::Object::HasProperty()", return false); | 3409 ON_BAILOUT(isolate, "v8::Object::HasProperty()", return false); |
| 3406 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3410 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 3407 return i::JSReceiver::HasElement(self, index); | 3411 return i::JSReceiver::HasElement(self, index); |
| 3408 } | 3412 } |
| 3409 | 3413 |
| (...skipping 4258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7668 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7672 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7669 Address callback_address = | 7673 Address callback_address = |
| 7670 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7674 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7671 VMState<EXTERNAL> state(isolate); | 7675 VMState<EXTERNAL> state(isolate); |
| 7672 ExternalCallbackScope call_scope(isolate, callback_address); | 7676 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7673 callback(info); | 7677 callback(info); |
| 7674 } | 7678 } |
| 7675 | 7679 |
| 7676 | 7680 |
| 7677 } } // namespace v8::internal | 7681 } } // namespace v8::internal |
| OLD | NEW |