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

Side by Side Diff: Source/bindings/tests/results/V8TestEventTarget.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 namespace WebCore { 67 namespace WebCore {
68 const WrapperTypeInfo V8TestEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink , V8TestEventTarget::domTemplate, V8TestEventTarget::derefObject, 0, V8TestEvent Target::toEventTarget, 0, V8TestEventTarget::installPerContextEnabledMethods, &V 8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype }; 68 const WrapperTypeInfo V8TestEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink , V8TestEventTarget::domTemplate, V8TestEventTarget::derefObject, 0, V8TestEvent Target::toEventTarget, 0, V8TestEventTarget::installPerContextEnabledMethods, &V 8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype };
69 69
70 namespace TestEventTargetV8Internal { 70 namespace TestEventTargetV8Internal {
71 71
72 template <typename T> void V8_USE(T) { } 72 template <typename T> void V8_USE(T) { }
73 73
74 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 74 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
75 { 75 {
76 if (UNLIKELY(info.Length() < 1)) { 76 if (info.Length() < 1) {
77 throwTypeError(ExceptionMessages::failedToExecute("item", "TestEventTarg et", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate() ); 77 throwTypeError(ExceptionMessages::failedToExecute("item", "TestEventTarg et", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate() );
78 return; 78 return;
79 } 79 }
80 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); 80 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
81 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[0])); 81 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[0]));
82 v8SetReturnValue(info, imp->item(index)); 82 v8SetReturnValue(info, imp->item(index));
83 } 83 }
84 84
85 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 85 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
86 { 86 {
87 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 87 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
88 TestEventTargetV8Internal::itemMethod(info); 88 TestEventTargetV8Internal::itemMethod(info);
89 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 89 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
90 } 90 }
91 91
92 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 92 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
93 { 93 {
94 if (UNLIKELY(info.Length() < 1)) { 94 if (info.Length() < 1) {
95 throwTypeError(ExceptionMessages::failedToExecute("namedItem", "TestEven tTarget", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsol ate()); 95 throwTypeError(ExceptionMessages::failedToExecute("namedItem", "TestEven tTarget", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsol ate());
96 return; 96 return;
97 } 97 }
98 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); 98 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
99 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); 99 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
100 v8SetReturnValue(info, imp->namedItem(name)); 100 v8SetReturnValue(info, imp->namedItem(name));
101 } 101 }
102 102
103 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 103 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
104 { 104 {
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 fromInternalPointer(object)->deref(); 351 fromInternalPointer(object)->deref();
352 } 352 }
353 353
354 template<> 354 template<>
355 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 355 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
356 { 356 {
357 return toV8(impl, creationContext, isolate); 357 return toV8(impl, creationContext, isolate);
358 } 358 }
359 359
360 } // namespace WebCore 360 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestCustomAccessors.cpp ('k') | Source/bindings/tests/results/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698