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 2795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2806 | 2806 |
2807 | 2807 |
2808 bool v8::Object::ForceDelete(v8::Handle<Value> key) { | 2808 bool v8::Object::ForceDelete(v8::Handle<Value> key) { |
2809 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2809 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2810 ON_BAILOUT(isolate, "v8::Object::ForceDelete()", return false); | 2810 ON_BAILOUT(isolate, "v8::Object::ForceDelete()", return false); |
2811 ENTER_V8(isolate); | 2811 ENTER_V8(isolate); |
2812 i::HandleScope scope(isolate); | 2812 i::HandleScope scope(isolate); |
2813 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2813 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2814 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); | 2814 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); |
2815 | 2815 |
2816 // When turning on access checks for a global object deoptimize all functions | 2816 // When deleting a property on the global object using ForceDelete |
2817 // as optimized code does not always handle access checks. | 2817 // deoptimize all functions as optimized code does not check for the hole |
2818 i::Deoptimizer::DeoptimizeGlobalObject(*self); | 2818 // value with DontDelete properties. We have to deoptimize all contexts |
| 2819 // because of possible cross-context inlined functions. |
| 2820 if (self->IsJSGlobalProxy() || self->IsGlobalObject()) { |
| 2821 i::Deoptimizer::DeoptimizeAll(); |
| 2822 } |
2819 | 2823 |
2820 EXCEPTION_PREAMBLE(isolate); | 2824 EXCEPTION_PREAMBLE(isolate); |
2821 i::Handle<i::Object> obj = i::ForceDeleteProperty(self, key_obj); | 2825 i::Handle<i::Object> obj = i::ForceDeleteProperty(self, key_obj); |
2822 has_pending_exception = obj.is_null(); | 2826 has_pending_exception = obj.is_null(); |
2823 EXCEPTION_BAILOUT_CHECK(isolate, false); | 2827 EXCEPTION_BAILOUT_CHECK(isolate, false); |
2824 return obj->IsTrue(); | 2828 return obj->IsTrue(); |
2825 } | 2829 } |
2826 | 2830 |
2827 | 2831 |
2828 Local<Value> v8::Object::Get(v8::Handle<Value> key) { | 2832 Local<Value> v8::Object::Get(v8::Handle<Value> key) { |
(...skipping 3583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6412 | 6416 |
6413 | 6417 |
6414 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 6418 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
6415 HandleScopeImplementer* scope_implementer = | 6419 HandleScopeImplementer* scope_implementer = |
6416 reinterpret_cast<HandleScopeImplementer*>(storage); | 6420 reinterpret_cast<HandleScopeImplementer*>(storage); |
6417 scope_implementer->IterateThis(v); | 6421 scope_implementer->IterateThis(v); |
6418 return storage + ArchiveSpacePerThread(); | 6422 return storage + ArchiveSpacePerThread(); |
6419 } | 6423 } |
6420 | 6424 |
6421 } } // namespace v8::internal | 6425 } } // namespace v8::internal |
OLD | NEW |