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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp

Issue 113783002: [POSSIBLE PERFORMANCE IMPACT] Remove UNLIKELY from bindings required arguments check (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove FIXME Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 static void bAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 120 static void bAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
121 { 121 {
122 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 122 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
123 RealClassV8Internal::bAttributeSetter(jsValue, info); 123 RealClassV8Internal::bAttributeSetter(jsValue, info);
124 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 124 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
125 } 125 }
126 126
127 static void func1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 127 static void func1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
128 { 128 {
129 if (UNLIKELY(info.Length() < 1)) { 129 if (info.Length() < 1) {
130 throwTypeError(ExceptionMessages::failedToExecute("func1", "TestInterfac eImplementedAs", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate()); 130 throwTypeError(ExceptionMessages::failedToExecute("func1", "TestInterfac eImplementedAs", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate());
131 return; 131 return;
132 } 132 }
133 RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder()); 133 RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder());
134 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, a, info[0]); 134 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, a, info[0]);
135 v8SetReturnValueString(info, imp->func1(a), info.GetIsolate()); 135 v8SetReturnValueString(info, imp->func1(a), info.GetIsolate());
136 } 136 }
137 137
138 static void func1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 138 static void func1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
139 { 139 {
140 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 140 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
141 RealClassV8Internal::func1Method(info); 141 RealClassV8Internal::func1Method(info);
142 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 142 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
143 } 143 }
144 144
145 static void funcTestInterfaceImplementedAsParamMethod(const v8::FunctionCallback Info<v8::Value>& info) 145 static void funcTestInterfaceImplementedAsParamMethod(const v8::FunctionCallback Info<v8::Value>& info)
146 { 146 {
147 if (UNLIKELY(info.Length() < 1)) { 147 if (info.Length() < 1) {
148 throwTypeError(ExceptionMessages::failedToExecute("funcTestInterfaceImpl ementedAsParam", "TestInterfaceImplementedAs", ExceptionMessages::notEnoughArgum ents(1, info.Length())), info.GetIsolate()); 148 throwTypeError(ExceptionMessages::failedToExecute("funcTestInterfaceImpl ementedAsParam", "TestInterfaceImplementedAs", ExceptionMessages::notEnoughArgum ents(1, info.Length())), info.GetIsolate());
149 return; 149 return;
150 } 150 }
151 RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder()); 151 RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder());
152 V8TRYCATCH_VOID(RealClass*, orange, V8TestInterfaceImplementedAs::hasInstanc e(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestInterfaceImp lementedAs::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); 152 V8TRYCATCH_VOID(RealClass*, orange, V8TestInterfaceImplementedAs::hasInstanc e(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestInterfaceImp lementedAs::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
153 v8SetReturnValueString(info, imp->funcTestInterfaceImplementedAsParam(orange ), info.GetIsolate()); 153 v8SetReturnValueString(info, imp->funcTestInterfaceImplementedAsParam(orange ), info.GetIsolate());
154 } 154 }
155 155
156 static void funcTestInterfaceImplementedAsParamMethodCallback(const v8::Function CallbackInfo<v8::Value>& info) 156 static void funcTestInterfaceImplementedAsParamMethodCallback(const v8::Function CallbackInfo<v8::Value>& info)
157 { 157 {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 fromInternalPointer(object)->deref(); 247 fromInternalPointer(object)->deref();
248 } 248 }
249 249
250 template<> 250 template<>
251 v8::Handle<v8::Value> toV8NoInline(RealClass* impl, v8::Handle<v8::Object> creat ionContext, v8::Isolate* isolate) 251 v8::Handle<v8::Value> toV8NoInline(RealClass* impl, v8::Handle<v8::Object> creat ionContext, v8::Isolate* isolate)
252 { 252 {
253 return toV8(impl, creationContext, isolate); 253 return toV8(impl, creationContext, isolate);
254 } 254 }
255 255
256 } // namespace WebCore 256 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceConstructor.cpp ('k') | Source/bindings/tests/results/V8TestNamedConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698