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

Side by Side Diff: src/objects.cc

Issue 1180073002: Introduce DefineOwnPropertyIgnoreAttributes and make it call SetPropertyWithInterceptor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | test/cctest/test-api-interceptors.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 <iomanip> 5 #include <iomanip>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 5060 matching lines...) Expand 10 before | Expand all | Expand 10 after
5071 // Make sure that the top context does not change when doing callbacks or 5071 // Make sure that the top context does not change when doing callbacks or
5072 // interceptor calls. 5072 // interceptor calls.
5073 AssertNoContextChange ncc(isolate); 5073 AssertNoContextChange ncc(isolate);
5074 5074
5075 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); 5075 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state());
5076 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); 5076 Handle<InterceptorInfo> interceptor(it->GetInterceptor());
5077 if (interceptor->deleter()->IsUndefined()) return MaybeHandle<Object>(); 5077 if (interceptor->deleter()->IsUndefined()) return MaybeHandle<Object>();
5078 5078
5079 Handle<JSObject> holder = it->GetHolder<JSObject>(); 5079 Handle<JSObject> holder = it->GetHolder<JSObject>();
5080 5080
5081 // TODO(verwaest): Temporary workaround for blink pretending to delete
5082 // elements that don't actually exist.
5083 Maybe<PropertyAttributes> attributes =
5084 GetPropertyAttributesWithInterceptor(it);
5085 CHECK(attributes.IsJust());
5086 if (attributes.FromJust() == ABSENT) return MaybeHandle<Object>();
5087
5081 PropertyCallbackArguments args(isolate, interceptor->data(), 5088 PropertyCallbackArguments args(isolate, interceptor->data(),
5082 *it->GetReceiver(), *holder); 5089 *it->GetReceiver(), *holder);
5083 v8::Handle<v8::Boolean> result; 5090 v8::Handle<v8::Boolean> result;
5084 if (it->IsElement()) { 5091 if (it->IsElement()) {
5085 uint32_t index = it->index(); 5092 uint32_t index = it->index();
5093
Igor Sheludko 2015/06/12 10:05:25 Spurious change.
5086 v8::IndexedPropertyDeleterCallback deleter = 5094 v8::IndexedPropertyDeleterCallback deleter =
5087 v8::ToCData<v8::IndexedPropertyDeleterCallback>(interceptor->deleter()); 5095 v8::ToCData<v8::IndexedPropertyDeleterCallback>(interceptor->deleter());
5088 LOG(isolate, 5096 LOG(isolate,
5089 ApiIndexedPropertyAccess("interceptor-indexed-delete", *holder, index)); 5097 ApiIndexedPropertyAccess("interceptor-indexed-delete", *holder, index));
5090 result = args.Call(deleter, index); 5098 result = args.Call(deleter, index);
5091 } else if (it->name()->IsSymbol() && !interceptor->can_intercept_symbols()) { 5099 } else if (it->name()->IsSymbol() && !interceptor->can_intercept_symbols()) {
5092 return MaybeHandle<Object>(); 5100 return MaybeHandle<Object>();
5093 } else { 5101 } else {
5094 Handle<Name> name = it->name(); 5102 Handle<Name> name = it->name();
5095 v8::GenericNamedPropertyDeleterCallback deleter = 5103 v8::GenericNamedPropertyDeleterCallback deleter =
(...skipping 11541 matching lines...) Expand 10 before | Expand all | Expand 10 after
16637 Handle<Object> new_value) { 16645 Handle<Object> new_value) {
16638 if (cell->value() != *new_value) { 16646 if (cell->value() != *new_value) {
16639 cell->set_value(*new_value); 16647 cell->set_value(*new_value);
16640 Isolate* isolate = cell->GetIsolate(); 16648 Isolate* isolate = cell->GetIsolate();
16641 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16649 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16642 isolate, DependentCode::kPropertyCellChangedGroup); 16650 isolate, DependentCode::kPropertyCellChangedGroup);
16643 } 16651 }
16644 } 16652 }
16645 } // namespace internal 16653 } // namespace internal
16646 } // namespace v8 16654 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698