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

Side by Side Diff: src/objects.cc

Issue 1126103006: Provide accessor for object internal properties that doesn't require debugger to be active (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/objects.h ('k') | src/runtime/runtime.h » ('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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 const Object* fun = this; 105 const Object* fun = this;
106 while (fun->IsJSFunctionProxy()) { 106 while (fun->IsJSFunctionProxy()) {
107 fun = JSFunctionProxy::cast(fun)->call_trap(); 107 fun = JSFunctionProxy::cast(fun)->call_trap();
108 } 108 }
109 return fun->IsJSFunction() || 109 return fun->IsJSFunction() ||
110 (fun->IsHeapObject() && 110 (fun->IsHeapObject() &&
111 HeapObject::cast(fun)->map()->has_instance_call_handler()); 111 HeapObject::cast(fun)->map()->has_instance_call_handler());
112 } 112 }
113 113
114 114
115 bool Object::IsPromise(Handle<Object> object) {
116 if (!object->IsJSObject()) return false;
117 auto js_object = Handle<JSObject>::cast(object);
118 // Promises can't have access checks.
119 if (js_object->map()->is_access_check_needed()) return false;
120 auto isolate = js_object->GetIsolate();
121 // TODO(dcarney): this should just be read from the symbol registry so as not
122 // to be context dependent.
123 auto key = isolate->promise_status();
124 // Shouldn't be possible to throw here.
125 return JSObject::HasRealNamedProperty(js_object, key).FromJust();
126 }
127
128
115 MaybeHandle<Object> Object::GetProperty(LookupIterator* it) { 129 MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
116 for (; it->IsFound(); it->Next()) { 130 for (; it->IsFound(); it->Next()) {
117 switch (it->state()) { 131 switch (it->state()) {
118 case LookupIterator::NOT_FOUND: 132 case LookupIterator::NOT_FOUND:
119 case LookupIterator::TRANSITION: 133 case LookupIterator::TRANSITION:
120 UNREACHABLE(); 134 UNREACHABLE();
121 case LookupIterator::JSPROXY: 135 case LookupIterator::JSPROXY:
122 return JSProxy::GetPropertyWithHandler(it->GetHolder<JSProxy>(), 136 return JSProxy::GetPropertyWithHandler(it->GetHolder<JSProxy>(),
123 it->GetReceiver(), it->name()); 137 it->GetReceiver(), it->name());
124 case LookupIterator::INTERCEPTOR: { 138 case LookupIterator::INTERCEPTOR: {
(...skipping 17113 matching lines...) Expand 10 before | Expand all | Expand 10 after
17238 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17252 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17239 Handle<Object> new_value) { 17253 Handle<Object> new_value) {
17240 if (cell->value() != *new_value) { 17254 if (cell->value() != *new_value) {
17241 cell->set_value(*new_value); 17255 cell->set_value(*new_value);
17242 Isolate* isolate = cell->GetIsolate(); 17256 Isolate* isolate = cell->GetIsolate();
17243 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17257 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17244 isolate, DependentCode::kPropertyCellChangedGroup); 17258 isolate, DependentCode::kPropertyCellChangedGroup);
17245 } 17259 }
17246 } 17260 }
17247 } } // namespace v8::internal 17261 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698