本文整理汇总了Python中builtins_generator.BuiltinsGenerator类的典型用法代码示例。如果您正苦于以下问题:Python BuiltinsGenerator类的具体用法?Python BuiltinsGenerator怎么用?Python BuiltinsGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BuiltinsGenerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_members
def generate_members(self):
guards = set([object.annotations.get('conditional') for object in self.internals if 'conditional' in object.annotations])
lines = [BuiltinsGenerator.wrap_with_guard(" || ".join(guards), " JSC::VM& m_vm;")]
for object in self.internals:
member = " %s %s;" % (self.member_type(object), self.member_name(object))
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), member))
return '\n'.join(lines)
示例2: generate_constructor
def generate_constructor(self):
guards = set([object.annotations.get('conditional') for object in self.internals if 'conditional' in object.annotations])
lines = ["JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm)",
BuiltinsGenerator.wrap_with_guard(" || ".join(guards), " : m_vm(vm)")]
for object in self.internals:
initializer = " , %s(m_vm)" % self.member_name(object)
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), initializer))
lines.append("{")
lines.append(" UNUSED_PARAM(vm);")
lines.append("}\n")
return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:11,代码来源:builtins_generate_internals_wrapper_implementation.py
示例3: generate_constructor
def generate_constructor(self):
lines = [" explicit JSBuiltinFunctions(JSC::VM& vm)",
" : m_vm(vm)"]
for object in self.model().objects:
member_init = " , %s(&m_vm)" % self.member_name(object)
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), member_init))
lines.append(" {")
for object in self.model().objects:
if not 'internal' in object.annotations:
continue
internal_export_names = " %s.exportNames();" % self.member_name(object)
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), internal_export_names))
lines.append(" }\n")
return '\n'.join(lines)
示例4: generate_initialize_method
def generate_initialize_method(self):
lines = ["void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)",
"{",
" UNUSED_PARAM(globalObject);"]
for object in self.internals:
init = " %s.init(globalObject);" % self.member_name(object)
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), init))
lines.append("")
guards = set([object.annotations.get('conditional') for object in self.internals if 'conditional' in object.annotations])
lines.append(BuiltinsGenerator.wrap_with_guard(" || ".join(guards), self._generate_initialize_static_globals()))
lines.append("}")
return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:15,代码来源:builtins_generate_internals_wrapper_implementation.py
示例5: generate_accessors
def generate_accessors(self):
lines = []
for object in self.internals:
accessor = " %s& %s() { return %s; }" % (self.member_type(object), self.accessor_name(object), self.member_name(object))
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), accessor))
lines.append("")
return '\n'.join(lines)
示例6: _generate_initialize_static_globals
def _generate_initialize_static_globals(self):
lines = [" JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);",
" JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {"]
for object in self.internals:
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), self.property_macro(object)))
lines.append(" };")
lines.append(" globalObject.addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));")
lines.append(" UNUSED_PARAM(clientData);")
return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:builtins_generate_internals_wrapper_implementation.py
示例7: generate_visit_method
def generate_visit_method(self):
lines = ["void JSBuiltinInternalFunctions::visit(JSC::SlotVisitor& visitor)",
"{"]
for object in self.internals:
visit = " %s.visit(visitor);" % self.member_name(object)
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), visit))
lines.append(" UNUSED_PARAM(visitor);")
lines.append("}\n")
return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:builtins_generate_internals_wrapper_implementation.py
示例8: generate_externs_for_object
def generate_externs_for_object(self, object):
lines = []
for function in object.functions:
function_args = {
'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
}
lines.append("""extern const char* s_%(codeName)s;
extern const int s_%(codeName)sLength;
extern const JSC::ConstructAbility s_%(codeName)sConstructAbility;""" % function_args)
return lines
示例9: generate_section_for_code_table_macro
def generate_section_for_code_table_macro(self):
args = {
'macroPrefix': self.model().framework.setting('macro_prefix'),
}
lines = []
lines.append("#define %(macroPrefix)s_FOREACH_BUILTIN_CODE(macro) \\" % args)
for function in self.model().all_functions():
function_args = {
'funcName': function.function_name,
'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
}
lines.append(" macro(%(codeName)s, %(funcName)s, s_%(codeName)sLength) \\" % function_args)
return '\n'.join(lines)
示例10: generate_macros_for_object
def generate_macros_for_object(self, object):
args = {
'macroPrefix': self.model().framework.setting('macro_prefix'),
'objectMacro': object.object_name.replace('.', '').upper(),
}
lines = []
lines.append("#define %(macroPrefix)s_FOREACH_%(objectMacro)s_BUILTIN_DATA(macro) \\" % args)
for function in object.functions:
function_args = {
'funcName': function.function_name,
'mangledName': BuiltinsGenerator.mangledNameForFunction(function),
'paramCount': len(function.parameters),
}
lines.append(" macro(%(funcName)s, %(mangledName)s, %(paramCount)d) \\" % function_args)
return lines
示例11: generate_section_for_global_private_code_name_macro
def generate_section_for_global_private_code_name_macro(self):
args = {
'macroPrefix': self.model().framework.setting('macro_prefix'),
}
lines = []
lines.append("#define %(macroPrefix)s_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \\" % args)
functions = filter(lambda function: function.is_global_private, self.model().all_functions())
functions.sort(key=lambda x: x.function_name)
for function in functions:
function_args = {
'funcName': function.function_name,
'codeName': BuiltinsGenerator.mangledNameForFunction(function),
}
lines.append(" macro(%(funcName)s, %(codeName)s) \\" % function_args)
return '\n'.join(lines)
示例12: generate_members
def generate_members(self):
lines = [" JSC::VM& m_vm;"]
for object in self.model().objects:
member = " %s %s;" % (self.member_type(object), self.member_name(object))
lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), member))
return '\n'.join(lines)
示例13: __init__
def __init__(self, model):
BuiltinsGenerator.__init__(self, model)
self.internals = filter(lambda object: 'internal' in object.annotations, model.objects)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:3,代码来源:builtins_generate_internals_wrapper_implementation.py
示例14: __init__
def __init__(self, model):
BuiltinsGenerator.__init__(self, model)
self.internals = [object for object in model.objects if 'internal' in object.annotations]
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:3,代码来源:builtins_generate_internals_wrapper_implementation.py
示例15: __init__
def __init__(self, model, object):
BuiltinsGenerator.__init__(self, model)
self.object = object