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

Side by Side Diff: src/api.cc

Issue 64643008: api: add {Function,Object}Template::GetIsolate()
Patch Set: Created 7 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 unified diff | Download patch
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 v8::Handle<v8::Data> data[kSize] = { 970 v8::Handle<v8::Data> data[kSize] = {
971 name, 971 name,
972 getter, 972 getter,
973 setter, 973 setter,
974 v8::Integer::New(attribute), 974 v8::Integer::New(attribute),
975 v8::Integer::New(access_control)}; 975 v8::Integer::New(access_control)};
976 TemplateSet(isolate, this, kSize, data); 976 TemplateSet(isolate, this, kSize, data);
977 } 977 }
978 978
979 979
980 Isolate* Template::GetIsolate() {
981 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
982 return reinterpret_cast<Isolate*>(isolate);
983 }
984
985
980 // --- F u n c t i o n T e m p l a t e --- 986 // --- F u n c t i o n T e m p l a t e ---
981 static void InitializeFunctionTemplate( 987 static void InitializeFunctionTemplate(
982 i::Handle<i::FunctionTemplateInfo> info) { 988 i::Handle<i::FunctionTemplateInfo> info) {
983 info->set_tag(i::Smi::FromInt(Consts::FUNCTION_TEMPLATE)); 989 info->set_tag(i::Smi::FromInt(Consts::FUNCTION_TEMPLATE));
984 info->set_flag(0); 990 info->set_flag(0);
985 } 991 }
986 992
987 993
988 Local<ObjectTemplate> FunctionTemplate::PrototypeTemplate() { 994 Local<ObjectTemplate> FunctionTemplate::PrototypeTemplate() {
989 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 995 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
(...skipping 6588 matching lines...) Expand 10 before | Expand all | Expand 10 after
7578 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7584 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7579 Address callback_address = 7585 Address callback_address =
7580 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7586 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7581 VMState<EXTERNAL> state(isolate); 7587 VMState<EXTERNAL> state(isolate);
7582 ExternalCallbackScope call_scope(isolate, callback_address); 7588 ExternalCallbackScope call_scope(isolate, callback_address);
7583 callback(info); 7589 callback(info);
7584 } 7590 }
7585 7591
7586 7592
7587 } } // namespace v8::internal 7593 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698