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

Side by Side Diff: src/objects.cc

Issue 1500553002: [runtime] [proxy] Remove JSProxy::CallTrap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removing CallTrap Created 5 years 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 | « src/objects.h ('k') | no next file » | 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 "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 4804 matching lines...) Expand 10 before | Expand all | Expand 10 after
4815 PropertyDescriptor desc; 4815 PropertyDescriptor desc;
4816 bool found = JSProxy::GetOwnPropertyDescriptor( 4816 bool found = JSProxy::GetOwnPropertyDescriptor(
4817 isolate, it->GetHolder<JSProxy>(), it->GetName(), &desc); 4817 isolate, it->GetHolder<JSProxy>(), it->GetName(), &desc);
4818 if (isolate->has_pending_exception()) return Nothing<PropertyAttributes>(); 4818 if (isolate->has_pending_exception()) return Nothing<PropertyAttributes>();
4819 if (!found) return Just(ABSENT); 4819 if (!found) return Just(ABSENT);
4820 return Just(desc.ToAttributes()); 4820 return Just(desc.ToAttributes());
4821 } 4821 }
4822 4822
4823 4823
4824 MaybeHandle<Object> JSProxy::GetTrap(Handle<JSProxy> proxy, 4824 MaybeHandle<Object> JSProxy::GetTrap(Handle<JSProxy> proxy,
4825 Handle<String> trap) { 4825 Handle<String> trap_name) {
4826 DCHECK(!proxy->IsRevoked()); 4826 DCHECK(!proxy->IsRevoked());
4827 Isolate* isolate = proxy->GetIsolate(); 4827 Isolate* isolate = proxy->GetIsolate();
4828 Handle<JSReceiver> handler(JSReceiver::cast(proxy->handler()), isolate); 4828 Handle<JSReceiver> handler(JSReceiver::cast(proxy->handler()), isolate);
4829 return Object::GetMethod(handler, trap); 4829 return Object::GetMethod(handler, trap_name);
4830 } 4830 }
4831 4831
4832 4832
4833 MaybeHandle<Object> JSProxy::CallTrap(Handle<JSProxy> proxy,
4834 const char* name,
4835 Handle<Object> derived,
4836 int argc,
4837 Handle<Object> argv[]) {
4838 Isolate* isolate = proxy->GetIsolate();
4839 Handle<Object> handler(proxy->handler(), isolate);
4840 Handle<String> trap_name = isolate->factory()->InternalizeUtf8String(name);
4841 Handle<Object> trap;
4842 ASSIGN_RETURN_ON_EXCEPTION(isolate, trap, GetTrap(proxy, trap_name), Object);
4843
4844 if (trap->IsUndefined()) {
4845 if (derived.is_null()) {
4846 THROW_NEW_ERROR(isolate,
4847 NewTypeError(MessageTemplate::kProxyHandlerTrapMissing,
4848 handler, trap_name),
4849 Object);
4850 }
4851 trap = Handle<Object>(derived);
4852 }
4853
4854 return Execution::Call(isolate, trap, handler, argc, argv);
4855 }
4856
4857
4858 void JSObject::AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map) { 4833 void JSObject::AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map) {
4859 DCHECK(object->map()->GetInObjectProperties() == 4834 DCHECK(object->map()->GetInObjectProperties() ==
4860 map->GetInObjectProperties()); 4835 map->GetInObjectProperties());
4861 ElementsKind obj_kind = object->map()->elements_kind(); 4836 ElementsKind obj_kind = object->map()->elements_kind();
4862 ElementsKind map_kind = map->elements_kind(); 4837 ElementsKind map_kind = map->elements_kind();
4863 if (map_kind != obj_kind) { 4838 if (map_kind != obj_kind) {
4864 ElementsKind to_kind = GetMoreGeneralElementsKind(map_kind, obj_kind); 4839 ElementsKind to_kind = GetMoreGeneralElementsKind(map_kind, obj_kind);
4865 if (IsDictionaryElementsKind(obj_kind)) { 4840 if (IsDictionaryElementsKind(obj_kind)) {
4866 to_kind = obj_kind; 4841 to_kind = obj_kind;
4867 } 4842 }
(...skipping 14187 matching lines...) Expand 10 before | Expand all | Expand 10 after
19055 if (cell->value() != *new_value) { 19030 if (cell->value() != *new_value) {
19056 cell->set_value(*new_value); 19031 cell->set_value(*new_value);
19057 Isolate* isolate = cell->GetIsolate(); 19032 Isolate* isolate = cell->GetIsolate();
19058 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19033 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19059 isolate, DependentCode::kPropertyCellChangedGroup); 19034 isolate, DependentCode::kPropertyCellChangedGroup);
19060 } 19035 }
19061 } 19036 }
19062 19037
19063 } // namespace internal 19038 } // namespace internal
19064 } // namespace v8 19039 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698