Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: src/api.cc

Issue 845403002: Reduce number of deopts caused by ForceDelete. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after
3058 3058
3059 3059
3060 bool v8::Object::ForceDelete(v8::Handle<Value> key) { 3060 bool v8::Object::ForceDelete(v8::Handle<Value> key) {
3061 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3061 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3062 ON_BAILOUT(isolate, "v8::Object::ForceDelete()", return false); 3062 ON_BAILOUT(isolate, "v8::Object::ForceDelete()", return false);
3063 ENTER_V8(isolate); 3063 ENTER_V8(isolate);
3064 i::HandleScope scope(isolate); 3064 i::HandleScope scope(isolate);
3065 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3065 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3066 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); 3066 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
3067 3067
3068 // When deleting a property on the global object using ForceDelete
3069 // deoptimize all functions as optimized code does not check for the hole
3070 // value with DontDelete properties. We have to deoptimize all contexts
3071 // because of possible cross-context inlined functions.
3072 if (self->IsJSGlobalProxy() || self->IsGlobalObject()) {
3073 i::Deoptimizer::DeoptimizeAll(isolate);
3074 }
3075
3076 EXCEPTION_PREAMBLE(isolate); 3068 EXCEPTION_PREAMBLE(isolate);
3077 i::Handle<i::Object> obj; 3069 i::Handle<i::Object> obj;
3078 has_pending_exception = 3070 has_pending_exception =
3079 !DeleteObjectProperty(isolate, self, key_obj, 3071 !DeleteObjectProperty(isolate, self, key_obj,
3080 i::JSReceiver::FORCE_DELETION).ToHandle(&obj); 3072 i::JSReceiver::FORCE_DELETION).ToHandle(&obj);
3081 EXCEPTION_BAILOUT_CHECK(isolate, false); 3073 EXCEPTION_BAILOUT_CHECK(isolate, false);
3082 return obj->IsTrue(); 3074 return obj->IsTrue();
3083 } 3075 }
3084 3076
3085 3077
(...skipping 4545 matching lines...) Expand 10 before | Expand all | Expand 10 after
7631 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7623 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7632 Address callback_address = 7624 Address callback_address =
7633 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7625 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7634 VMState<EXTERNAL> state(isolate); 7626 VMState<EXTERNAL> state(isolate);
7635 ExternalCallbackScope call_scope(isolate, callback_address); 7627 ExternalCallbackScope call_scope(isolate, callback_address);
7636 callback(info); 7628 callback(info);
7637 } 7629 }
7638 7630
7639 7631
7640 } } // namespace v8::internal 7632 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698