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

Side by Side Diff: src/runtime/runtime-utils.h

Issue 1124813005: WIP Atomics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix AtomicsLoad type in typer.cc Created 5 years, 7 months 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
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/mjsunit/asm/atomics-load.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_RUNTIME_RUNTIME_UTILS_H_ 5 #ifndef V8_RUNTIME_RUNTIME_UTILS_H_
6 #define V8_RUNTIME_RUNTIME_UTILS_H_ 6 #define V8_RUNTIME_RUNTIME_UTILS_H_
7 7
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 RUNTIME_ASSERT(args[index]->IsSmi()); \ 47 RUNTIME_ASSERT(args[index]->IsSmi()); \
48 int name = args.smi_at(index); 48 int name = args.smi_at(index);
49 49
50 // Cast the given argument to a double and store it in a variable with 50 // Cast the given argument to a double and store it in a variable with
51 // the given name. If the argument is not a number (as opposed to 51 // the given name. If the argument is not a number (as opposed to
52 // the number not-a-number) call IllegalOperation and return. 52 // the number not-a-number) call IllegalOperation and return.
53 #define CONVERT_DOUBLE_ARG_CHECKED(name, index) \ 53 #define CONVERT_DOUBLE_ARG_CHECKED(name, index) \
54 RUNTIME_ASSERT(args[index]->IsNumber()); \ 54 RUNTIME_ASSERT(args[index]->IsNumber()); \
55 double name = args.number_at(index); 55 double name = args.number_at(index);
56 56
57
58 // TODO(binji): document
59 #define CONVERT_SIZE_ARG_CHECKED(name, index) \
60 RUNTIME_ASSERT(args[index]->IsNumber()); \
61 Handle<Object> name##_object = args.at<Object>(index); \
62 size_t name = 0; \
63 RUNTIME_ASSERT(TryNumberToSize(isolate, *name##_object, &name));
64
65
57 // Call the specified converter on the object *comand store the result in 66 // Call the specified converter on the object *comand store the result in
58 // a variable of the specified type with the given name. If the 67 // a variable of the specified type with the given name. If the
59 // object is not a Number call IllegalOperation and return. 68 // object is not a Number call IllegalOperation and return.
60 #define CONVERT_NUMBER_CHECKED(type, name, Type, obj) \ 69 #define CONVERT_NUMBER_CHECKED(type, name, Type, obj) \
61 RUNTIME_ASSERT(obj->IsNumber()); \ 70 RUNTIME_ASSERT(obj->IsNumber()); \
62 type name = NumberTo##Type(obj); 71 type name = NumberTo##Type(obj);
63 72
64 73
65 // Cast the given argument to PropertyDetails and store its value in a 74 // Cast the given argument to PropertyDetails and store its value in a
66 // variable with the given name. If the argument is not a Smi call 75 // variable with the given name. If the argument is not a Smi call
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 #else 156 #else
148 #error Unknown endianness 157 #error Unknown endianness
149 #endif 158 #endif
150 } 159 }
151 #endif 160 #endif
152 161
153 } 162 }
154 } // namespace v8::internal 163 } // namespace v8::internal
155 164
156 #endif // V8_RUNTIME_RUNTIME_UTILS_H_ 165 #endif // V8_RUNTIME_RUNTIME_UTILS_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/mjsunit/asm/atomics-load.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698