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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceConstructor.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 namespace WebCore { 66 namespace WebCore {
67 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor:: derefObject, 0, 0, 0, V8TestInterfaceConstructor::installPerContextEnabledMethod s, 0, WrapperTypeObjectPrototype }; 67 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor:: derefObject, 0, 0, 0, V8TestInterfaceConstructor::installPerContextEnabledMethod s, 0, WrapperTypeObjectPrototype };
68 68
69 namespace TestInterfaceConstructorV8Internal { 69 namespace TestInterfaceConstructorV8Internal {
70 70
71 template <typename T> void V8_USE(T) { } 71 template <typename T> void V8_USE(T) { }
72 72
73 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 73 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
74 { 74 {
75 if (UNLIKELY(info.Length() < 2)) { 75 if (info.Length() < 2) {
76 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestIn terfaceConstructor", ExceptionMessages::notEnoughArguments(2, info.Length())), i nfo.GetIsolate()); 76 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestIn terfaceConstructor", ExceptionMessages::notEnoughArguments(2, info.Length())), i nfo.GetIsolate());
77 return; 77 return;
78 } 78 }
79 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 79 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
80 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArgument, inf o[0]); 80 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArgument, inf o[0]);
81 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArgument2, in fo[1]); 81 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArgument2, in fo[1]);
82 ExecutionContext* context = getExecutionContext(); 82 ExecutionContext* context = getExecutionContext();
83 Document& document = *toDocument(getExecutionContext()); 83 Document& document = *toDocument(getExecutionContext());
84 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, stringArgument, stringArgument2, exceptionState); 84 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, stringArgument, stringArgument2, exceptionState);
85 v8::Handle<v8::Object> wrapper = info.Holder(); 85 v8::Handle<v8::Object> wrapper = info.Holder();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 fromInternalPointer(object)->deref(); 181 fromInternalPointer(object)->deref();
182 } 182 }
183 183
184 template<> 184 template<>
185 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 185 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
186 { 186 {
187 return toV8(impl, creationContext, isolate); 187 return toV8(impl, creationContext, isolate);
188 } 188 }
189 189
190 } // namespace WebCore 190 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698