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

Unified Diff: src/objects-inl.h

Issue 2170743003: [api] Introduce fast instantiations cache (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing uint issue under windows Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« src/objects.h ('K') | « src/objects.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index dfe8bd6cf1b28a22a325e814be378c937f44e07a..775ccbd4cec01e72065fb4467790b222d0d734e7 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2317,17 +2317,17 @@ Handle<Object> FixedArray::get(FixedArray* array, int index, Isolate* isolate) {
}
template <class T>
-MaybeHandle<T> FixedArray::GetValue(int index) const {
+MaybeHandle<T> FixedArray::GetValue(Isolate* isolate, int index) const {
Object* obj = get(index);
- if (obj->IsUndefined(GetIsolate())) return MaybeHandle<T>();
- return Handle<T>(T::cast(obj));
+ if (obj->IsUndefined(isolate)) return MaybeHandle<T>();
+ return Handle<T>(T::cast(obj), isolate);
}
template <class T>
-Handle<T> FixedArray::GetValueChecked(int index) const {
+Handle<T> FixedArray::GetValueChecked(Isolate* isolate, int index) const {
Object* obj = get(index);
- CHECK(!obj->IsUndefined(GetIsolate()));
- return Handle<T>(T::cast(obj));
+ CHECK(!obj->IsUndefined(isolate));
+ return Handle<T>(T::cast(obj), isolate);
}
bool FixedArray::is_the_hole(int index) {
@@ -5601,6 +5601,27 @@ bool FunctionTemplateInfo::instantiated() {
return shared_function_info()->IsSharedFunctionInfo();
}
+FunctionTemplateInfo* FunctionTemplateInfo::GetParent(Isolate* isolate) {
+ Object* parent = parent_template();
+ return parent->IsUndefined(isolate) ? nullptr
+ : FunctionTemplateInfo::cast(parent);
+}
+
+ObjectTemplateInfo* ObjectTemplateInfo::GetParent(Isolate* isolate) {
+ Object* maybe_ctor = constructor();
+ if (maybe_ctor->IsUndefined(isolate)) return nullptr;
+ FunctionTemplateInfo* constructor = FunctionTemplateInfo::cast(maybe_ctor);
+ while (true) {
+ constructor = constructor->GetParent(isolate);
+ if (constructor == nullptr) return nullptr;
+ Object* maybe_obj = constructor->instance_template();
+ if (!maybe_obj->IsUndefined(isolate)) {
+ return ObjectTemplateInfo::cast(maybe_obj);
+ }
+ }
+ return nullptr;
+}
+
ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset)
ACCESSORS(PrototypeInfo, object_create_map, Object, kObjectCreateMap)
SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset)
« src/objects.h ('K') | « src/objects.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698