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

Unified Diff: src/api-natives.cc

Issue 1434693008: Revert changes introduced in http://crrev.com/1367953002. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api-natives.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api-natives.cc
diff --git a/src/api-natives.cc b/src/api-natives.cc
index 0a070ced2417bce65c960fd7e08ea8d67c130433..d8dd1510417641197da707cf27f79e51586886d3 100644
--- a/src/api-natives.cc
+++ b/src/api-natives.cc
@@ -37,25 +37,6 @@ MaybeHandle<Object> Instantiate(Isolate* isolate, Handle<Object> data,
}
-MaybeHandle<JSFunction> InstantiateFunctionOrMaybeDont(Isolate* isolate,
- Handle<Object> data) {
- DCHECK(data->IsFunctionTemplateInfo() || data->IsJSFunction());
- if (data->IsFunctionTemplateInfo()) {
- // A function template needs to be instantiated.
- return InstantiateFunction(isolate,
- Handle<FunctionTemplateInfo>::cast(data));
-#ifdef V8_JS_ACCESSORS
- } else if (data->IsJSFunction()) {
- // If we already have a proper function, we do not need additional work.
- // (This should only happen for JavaScript API accessors.)
- return Handle<JSFunction>::cast(data);
-#endif // V8_JS_ACCESSORS
- } else {
- UNREACHABLE();
- return MaybeHandle<JSFunction>();
- }
-}
-
MaybeHandle<Object> DefineAccessorProperty(Isolate* isolate,
Handle<JSObject> object,
Handle<Name> name,
@@ -63,14 +44,18 @@ MaybeHandle<Object> DefineAccessorProperty(Isolate* isolate,
Handle<Object> setter,
PropertyAttributes attributes) {
if (!getter->IsUndefined()) {
- ASSIGN_RETURN_ON_EXCEPTION(isolate, getter,
- InstantiateFunctionOrMaybeDont(isolate, getter),
- Object);
+ ASSIGN_RETURN_ON_EXCEPTION(
+ isolate, getter,
+ InstantiateFunction(isolate,
+ Handle<FunctionTemplateInfo>::cast(getter)),
+ Object);
}
if (!setter->IsUndefined()) {
- ASSIGN_RETURN_ON_EXCEPTION(isolate, setter,
- InstantiateFunctionOrMaybeDont(isolate, setter),
- Object);
+ ASSIGN_RETURN_ON_EXCEPTION(
+ isolate, setter,
+ InstantiateFunction(isolate,
+ Handle<FunctionTemplateInfo>::cast(setter)),
+ Object);
}
RETURN_ON_EXCEPTION(isolate, JSObject::DefineAccessor(object, name, getter,
setter, attributes),
@@ -425,19 +410,10 @@ void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info,
void ApiNatives::AddAccessorProperty(Isolate* isolate,
Handle<TemplateInfo> info,
- Handle<Name> name, Handle<Object> getter,
- Handle<Object> setter,
+ Handle<Name> name,
+ Handle<FunctionTemplateInfo> getter,
+ Handle<FunctionTemplateInfo> setter,
PropertyAttributes attributes) {
-#ifdef V8_JS_ACCESSORS
- DCHECK(getter.is_null() || getter->IsFunctionTemplateInfo() ||
- getter->IsJSFunction());
- DCHECK(setter.is_null() || setter->IsFunctionTemplateInfo() ||
- setter->IsJSFunction());
-#else
- DCHECK(getter.is_null() || getter->IsFunctionTemplateInfo());
- DCHECK(setter.is_null() || setter->IsFunctionTemplateInfo());
-#endif // V8_JS_ACCESSORS
-
const int kSize = 4;
PropertyDetails details(attributes, ACCESSOR, 0, PropertyCellType::kNoCell);
auto details_handle = handle(details.AsSmi(), isolate);
« no previous file with comments | « src/api-natives.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698