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

Side by Side Diff: src/objects.cc

Issue 1758623002: Revert of [api] Don't go to javascript to construct API functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/execution.cc ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 Handle<Object> return_value = v8::Utils::OpenHandle(*result); 1074 Handle<Object> return_value = v8::Utils::OpenHandle(*result);
1075 return_value->VerifyApiCallResultType(); 1075 return_value->VerifyApiCallResultType();
1076 // Rebox handle before return. 1076 // Rebox handle before return.
1077 return handle(*return_value, isolate); 1077 return handle(*return_value, isolate);
1078 } 1078 }
1079 1079
1080 // Regular accessor. 1080 // Regular accessor.
1081 Handle<Object> getter(AccessorPair::cast(*structure)->getter(), isolate); 1081 Handle<Object> getter(AccessorPair::cast(*structure)->getter(), isolate);
1082 if (getter->IsFunctionTemplateInfo()) { 1082 if (getter->IsFunctionTemplateInfo()) {
1083 auto result = Builtins::InvokeApiFunction( 1083 auto result = Builtins::InvokeApiFunction(
1084 false, Handle<FunctionTemplateInfo>::cast(getter), receiver, 0, 1084 Handle<FunctionTemplateInfo>::cast(getter), receiver, 0, nullptr);
1085 nullptr);
1086 if (isolate->has_pending_exception()) { 1085 if (isolate->has_pending_exception()) {
1087 return MaybeHandle<Object>(); 1086 return MaybeHandle<Object>();
1088 } 1087 }
1089 Handle<Object> return_value; 1088 Handle<Object> return_value;
1090 if (result.ToHandle(&return_value)) { 1089 if (result.ToHandle(&return_value)) {
1091 return_value->VerifyApiCallResultType(); 1090 return_value->VerifyApiCallResultType();
1092 return handle(*return_value, isolate); 1091 return handle(*return_value, isolate);
1093 } 1092 }
1094 } else if (getter->IsCallable()) { 1093 } else if (getter->IsCallable()) {
1095 // TODO(rossberg): nicer would be to cast to some JSCallable here... 1094 // TODO(rossberg): nicer would be to cast to some JSCallable here...
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 should_throw); 1143 should_throw);
1145 args.Call(call_fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value)); 1144 args.Call(call_fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value));
1146 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); 1145 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>());
1147 return Just(true); 1146 return Just(true);
1148 } 1147 }
1149 1148
1150 // Regular accessor. 1149 // Regular accessor.
1151 Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate); 1150 Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate);
1152 if (setter->IsFunctionTemplateInfo()) { 1151 if (setter->IsFunctionTemplateInfo()) {
1153 Handle<Object> argv[] = {value}; 1152 Handle<Object> argv[] = {value};
1154 auto result = Builtins::InvokeApiFunction( 1153 auto result =
1155 false, Handle<FunctionTemplateInfo>::cast(setter), receiver, 1154 Builtins::InvokeApiFunction(Handle<FunctionTemplateInfo>::cast(setter),
1156 arraysize(argv), argv); 1155 receiver, arraysize(argv), argv);
1157 if (isolate->has_pending_exception()) { 1156 if (isolate->has_pending_exception()) {
1158 return Nothing<bool>(); 1157 return Nothing<bool>();
1159 } 1158 }
1160 return Just(true); 1159 return Just(true);
1161 } else if (setter->IsCallable()) { 1160 } else if (setter->IsCallable()) {
1162 // TODO(rossberg): nicer would be to cast to some JSCallable here... 1161 // TODO(rossberg): nicer would be to cast to some JSCallable here...
1163 return SetPropertyWithDefinedSetter( 1162 return SetPropertyWithDefinedSetter(
1164 receiver, Handle<JSReceiver>::cast(setter), value, should_throw); 1163 receiver, Handle<JSReceiver>::cast(setter), value, should_throw);
1165 } 1164 }
1166 1165
(...skipping 18658 matching lines...) Expand 10 before | Expand all | Expand 10 after
19825 if (cell->value() != *new_value) { 19824 if (cell->value() != *new_value) {
19826 cell->set_value(*new_value); 19825 cell->set_value(*new_value);
19827 Isolate* isolate = cell->GetIsolate(); 19826 Isolate* isolate = cell->GetIsolate();
19828 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19827 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19829 isolate, DependentCode::kPropertyCellChangedGroup); 19828 isolate, DependentCode::kPropertyCellChangedGroup);
19830 } 19829 }
19831 } 19830 }
19832 19831
19833 } // namespace internal 19832 } // namespace internal
19834 } // namespace v8 19833 } // namespace v8
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698