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

Side by Side Diff: Source/bindings/tests/results/V8TestNamedConstructor.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 Document* document = currentDocument(); 89 Document* document = currentDocument();
90 ASSERT(document); 90 ASSERT(document);
91 91
92 // Make sure the document is added to the DOM Node map. Otherwise, the TestN amedConstructor instance 92 // Make sure the document is added to the DOM Node map. Otherwise, the TestN amedConstructor instance
93 // may end up being the only node in the map and get garbage-collected prema turely. 93 // may end up being the only node in the map and get garbage-collected prema turely.
94 toV8(document, info.Holder(), info.GetIsolate()); 94 toV8(document, info.Holder(), info.GetIsolate());
95 95
96 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestName dConstructor", info.Holder(), info.GetIsolate()); 96 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestName dConstructor", info.Holder(), info.GetIsolate());
97 if (UNLIKELY(info.Length() < 1)) { 97 if (info.Length() < 1) {
98 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 98 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
99 exceptionState.throwIfNeeded(); 99 exceptionState.throwIfNeeded();
100 return; 100 return;
101 } 101 }
102 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); 102 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]);
103 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); 103 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]);
104 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul l(info, 2)); 104 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul l(info, 2));
105 105
106 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru ctor(*document, str1, str2, str3, exceptionState); 106 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru ctor(*document, str1, str2, str3, exceptionState);
107 v8::Handle<v8::Object> wrapper = info.Holder(); 107 v8::Handle<v8::Object> wrapper = info.Holder();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 fromInternalPointer(object)->deref(); 209 fromInternalPointer(object)->deref();
210 } 210 }
211 211
212 template<> 212 template<>
213 v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate) 213 v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate)
214 { 214 {
215 return toV8(impl, creationContext, isolate); 215 return toV8(impl, creationContext, isolate);
216 } 216 }
217 217
218 } // namespace WebCore 218 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698