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

Side by Side Diff: src/api-natives.cc

Issue 1609233002: Do not eagerly instantiate accessors' JSFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 11 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 | src/arguments.h » ('j') | src/crankshaft/hydrogen.cc » ('J')
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/api-natives.h" 5 #include "src/api-natives.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 24 matching lines...) Expand all
35 return data; 35 return data;
36 } 36 }
37 } 37 }
38 38
39 39
40 MaybeHandle<Object> DefineAccessorProperty(Isolate* isolate, 40 MaybeHandle<Object> DefineAccessorProperty(Isolate* isolate,
41 Handle<JSObject> object, 41 Handle<JSObject> object,
42 Handle<Name> name, 42 Handle<Name> name,
43 Handle<Object> getter, 43 Handle<Object> getter,
44 Handle<Object> setter, 44 Handle<Object> setter,
45 PropertyAttributes attributes) { 45 PropertyAttributes attributes) {
Toon Verwaest 2016/01/28 12:05:19 To default to not instantiating the FunctionTempla
epertoso 2016/02/01 16:18:03 Done. But I don't get how this changes the API. We
46 if (!getter->IsUndefined()) {
47 ASSIGN_RETURN_ON_EXCEPTION(
48 isolate, getter,
49 InstantiateFunction(isolate,
50 Handle<FunctionTemplateInfo>::cast(getter)),
51 Object);
52 }
53 if (!setter->IsUndefined()) {
54 ASSIGN_RETURN_ON_EXCEPTION(
55 isolate, setter,
56 InstantiateFunction(isolate,
57 Handle<FunctionTemplateInfo>::cast(setter)),
58 Object);
59 }
60 RETURN_ON_EXCEPTION(isolate, JSObject::DefineAccessor(object, name, getter, 46 RETURN_ON_EXCEPTION(isolate, JSObject::DefineAccessor(object, name, getter,
61 setter, attributes), 47 setter, attributes),
62 Object); 48 Object);
63 return object; 49 return object;
64 } 50 }
65 51
66 52
67 MaybeHandle<Object> DefineDataProperty(Isolate* isolate, 53 MaybeHandle<Object> DefineDataProperty(Isolate* isolate,
68 Handle<JSObject> object, 54 Handle<JSObject> object,
69 Handle<Name> name, 55 Handle<Name> name,
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); 600 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i)));
615 JSObject::SetAccessor(result, accessor).Assert(); 601 JSObject::SetAccessor(result, accessor).Assert();
616 } 602 }
617 603
618 DCHECK(result->shared()->IsApiFunction()); 604 DCHECK(result->shared()->IsApiFunction());
619 return result; 605 return result;
620 } 606 }
621 607
622 } // namespace internal 608 } // namespace internal
623 } // namespace v8 609 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/arguments.h » ('j') | src/crankshaft/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698