OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 28 matching lines...) Expand all Loading... | |
39 #define TOSTRING_VOID(type, var, value) \ | 39 #define TOSTRING_VOID(type, var, value) \ |
40 type var(value); \ | 40 type var(value); \ |
41 if (UNLIKELY(!var.prepare())) \ | 41 if (UNLIKELY(!var.prepare())) \ |
42 return; | 42 return; |
43 | 43 |
44 #define TOSTRING_DEFAULT(type, var, value, retVal) \ | 44 #define TOSTRING_DEFAULT(type, var, value, retVal) \ |
45 type var(value); \ | 45 type var(value); \ |
46 if (UNLIKELY(!var.prepare())) \ | 46 if (UNLIKELY(!var.prepare())) \ |
47 return retVal; | 47 return retVal; |
48 | 48 |
49 #define SMALL_ARRAY_BUFFER_VIEW_STORAGE(value) \ | |
haraken
2015/07/30 14:54:57
I'd rename this to allocateFlexibleArrayBufferView
haraken
2015/07/30 14:54:57
Add a comment about what this is doing.
Michael Lippautz
2015/07/30 17:06:14
Done.
Michael Lippautz
2015/07/30 17:06:15
Done.
| |
50 (value->IsArrayBufferView() && (value.As<v8::ArrayBufferView>()->ByteLength( ) <= 128) ? alloca(value.As<v8::ArrayBufferView>()->ByteLength()) : nullptr) | |
jochen (gone - plz use gerrit)
2015/07/30 14:30:06
should we change the default for on-heap typed arr
Michael Lippautz
2015/07/30 17:06:14
Changed to 64. Let's keep it in sync with V8's typ
| |
51 | |
52 | |
jochen (gone - plz use gerrit)
2015/07/30 14:30:06
nit. only one empty line
Michael Lippautz
2015/07/30 17:06:15
Done.
| |
49 template <typename T> | 53 template <typename T> |
50 inline bool v8Call(v8::Maybe<T> maybe, T& outVariable) | 54 inline bool v8Call(v8::Maybe<T> maybe, T& outVariable) |
51 { | 55 { |
52 if (maybe.IsNothing()) | 56 if (maybe.IsNothing()) |
53 return false; | 57 return false; |
54 outVariable = maybe.FromJust(); | 58 outVariable = maybe.FromJust(); |
55 return true; | 59 return true; |
56 } | 60 } |
57 | 61 |
58 inline bool v8CallBoolean(v8::Maybe<bool> maybe) | 62 inline bool v8CallBoolean(v8::Maybe<bool> maybe) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 | 95 |
92 // The last "else" is to avoid dangling else problem. | 96 // The last "else" is to avoid dangling else problem. |
93 #define V8_CALL(outVariable, handle, methodCall, failureExpression) \ | 97 #define V8_CALL(outVariable, handle, methodCall, failureExpression) \ |
94 if (handle.IsEmpty() || !v8Call(handle->methodCall, outVariable)) { \ | 98 if (handle.IsEmpty() || !v8Call(handle->methodCall, outVariable)) { \ |
95 failureExpression; \ | 99 failureExpression; \ |
96 } else | 100 } else |
97 | 101 |
98 } // namespace blink | 102 } // namespace blink |
99 | 103 |
100 #endif // V8BindingMacros_h | 104 #endif // V8BindingMacros_h |
OLD | NEW |