| OLD | NEW |
| 1 {##############################################################################} | 1 {##############################################################################} |
| 2 {% macro generate_method(method, world_suffix) %} | 2 {% macro generate_method(method, world_suffix) %} |
| 3 {% filter conditional(method.conditional_string) %} | 3 {% filter conditional(method.conditional_string) %} |
| 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 5 { | 5 { |
| 6 {# Local variables #} | 6 {# Local variables #} |
| 7 {% if method.has_exception_state %} | 7 {% if method.has_exception_state %} |
| 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); | 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); |
| 9 {% endif %} | 9 {% endif %} |
| 10 {# Overloaded methods have length checked during overload resolution #} | 10 {# Overloaded methods have length checked during overload resolution #} |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 {% endif %} | 428 {% endif %} |
| 429 {% endif %}{# not method.overloads #} | 429 {% endif %}{# not method.overloads #} |
| 430 {% if world_suffix in method.activity_logging_world_list %} | 430 {% if world_suffix in method.activity_logging_world_list %} |
| 431 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); | 431 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); |
| 432 V8PerContextData* contextData = scriptState->perContextData(); | 432 V8PerContextData* contextData = scriptState->perContextData(); |
| 433 {% if method.activity_logging_world_check %} | 433 {% if method.activity_logging_world_check %} |
| 434 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) | 434 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
| 435 {% else %} | 435 {% else %} |
| 436 if (contextData && contextData->activityLogger()) { | 436 if (contextData && contextData->activityLogger()) { |
| 437 {% endif %} | 437 {% endif %} |
| 438 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0) | |
| 439 and delete toVectorOfArguments #} | |
| 440 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 438 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
| 441 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); | 439 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); |
| 442 } | 440 } |
| 443 {% endif %} | 441 {% endif %} |
| 444 {% if method.is_custom %} | 442 {% if method.is_custom %} |
| 445 {{v8_class}}::{{method.name}}MethodCustom(info); | 443 {{v8_class}}::{{method.name}}MethodCustom(info); |
| 446 {% else %} | 444 {% else %} |
| 447 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); | 445 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); |
| 448 {% endif %} | 446 {% endif %} |
| 449 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 447 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { | 566 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { |
| 569 v8SetReturnValue(info, info.Holder()); | 567 v8SetReturnValue(info, info.Holder()); |
| 570 return; | 568 return; |
| 571 } | 569 } |
| 572 {% endif %} | 570 {% endif %} |
| 573 {% if constructor.has_exception_state %} | 571 {% if constructor.has_exception_state %} |
| 574 ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interf
ace_name}}", info.Holder(), info.GetIsolate()); | 572 ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interf
ace_name}}", info.Holder(), info.GetIsolate()); |
| 575 {% endif %} | 573 {% endif %} |
| 576 {# Overloaded constructors have length checked during overload resolution #} | 574 {# Overloaded constructors have length checked during overload resolution #} |
| 577 {% if constructor.number_of_required_arguments and not constructor.overload_
index %} | 575 {% if constructor.number_of_required_arguments and not constructor.overload_
index %} |
| 578 {# FIXME: remove UNLIKELY: constructors are expensive, so no difference. #} | 576 if (info.Length() < {{constructor.number_of_required_arguments}}) { |
| 579 if (UNLIKELY(info.Length() < {{constructor.number_of_required_arguments}}))
{ | |
| 580 {{throw_minimum_arity_type_error(constructor, constructor.number_of_requ
ired_arguments)}}; | 577 {{throw_minimum_arity_type_error(constructor, constructor.number_of_requ
ired_arguments)}}; |
| 581 return; | 578 return; |
| 582 } | 579 } |
| 583 {% endif %} | 580 {% endif %} |
| 584 {% if constructor.arguments %} | 581 {% if constructor.arguments %} |
| 585 {{generate_arguments(constructor) | indent}} | 582 {{generate_arguments(constructor) | indent}} |
| 586 {% endif %} | 583 {% endif %} |
| 587 {{cpp_method_call(constructor, constructor.v8_set_return_value, constructor.
cpp_value) | indent}} | 584 {{cpp_method_call(constructor, constructor.v8_set_return_value, constructor.
cpp_value) | indent}} |
| 588 } | 585 } |
| 589 {% endmacro %} | 586 {% endmacro %} |
| 590 | 587 |
| 591 | 588 |
| 592 {##############################################################################} | 589 {##############################################################################} |
| 593 {% macro generate_constructor_wrapper(constructor) %} | 590 {% macro generate_constructor_wrapper(constructor) %} |
| 594 {% if has_custom_wrap %} | 591 {% if has_custom_wrap %} |
| 595 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIsolate
()); | 592 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIsolate
()); |
| 596 {% else %} | 593 {% else %} |
| 597 {% set constructor_class = v8_class + ('Constructor' | 594 {% set constructor_class = v8_class + ('Constructor' |
| 598 if constructor.is_named_constructor else | 595 if constructor.is_named_constructor else |
| 599 '') %} | 596 '') %} |
| 600 v8::Handle<v8::Object> wrapper = info.Holder(); | 597 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 601 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{constr
uctor_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_configurat
ion}}); | 598 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{constr
uctor_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_configurat
ion}}); |
| 602 {% endif %} | 599 {% endif %} |
| 603 v8SetReturnValue(info, wrapper); | 600 v8SetReturnValue(info, wrapper); |
| 604 {% endmacro %} | 601 {% endmacro %} |
| OLD | NEW |