OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 6189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6200 | 6200 |
6201 // List of builtin functions we want to identify to improve code | 6201 // List of builtin functions we want to identify to improve code |
6202 // generation. | 6202 // generation. |
6203 // | 6203 // |
6204 // Each entry has a name of a global object property holding an object | 6204 // Each entry has a name of a global object property holding an object |
6205 // optionally followed by ".prototype", a name of a builtin function | 6205 // optionally followed by ".prototype", a name of a builtin function |
6206 // on the object (the one the id is set for), and a label. | 6206 // on the object (the one the id is set for), and a label. |
6207 // | 6207 // |
6208 // Installation of ids for the selected builtin functions is handled | 6208 // Installation of ids for the selected builtin functions is handled |
6209 // by the bootstrapper. | 6209 // by the bootstrapper. |
6210 // | |
6211 // NOTE: Order is important: math functions should be at the end of | |
6212 // the list and MathFloor should be the first math function. | |
6213 #define FUNCTIONS_WITH_ID_LIST(V) \ | 6210 #define FUNCTIONS_WITH_ID_LIST(V) \ |
6214 V(Array.prototype, push, ArrayPush) \ | 6211 V(Array.prototype, push, ArrayPush) \ |
6215 V(Array.prototype, pop, ArrayPop) \ | 6212 V(Array.prototype, pop, ArrayPop) \ |
6216 V(Function.prototype, apply, FunctionApply) \ | 6213 V(Function.prototype, apply, FunctionApply) \ |
6217 V(String.prototype, charCodeAt, StringCharCodeAt) \ | 6214 V(String.prototype, charCodeAt, StringCharCodeAt) \ |
6218 V(String.prototype, charAt, StringCharAt) \ | 6215 V(String.prototype, charAt, StringCharAt) \ |
6219 V(String, fromCharCode, StringFromCharCode) \ | 6216 V(String, fromCharCode, StringFromCharCode) \ |
6220 V(Math, floor, MathFloor) \ | 6217 V(Math, floor, MathFloor) \ |
6221 V(Math, round, MathRound) \ | 6218 V(Math, round, MathRound) \ |
6222 V(Math, ceil, MathCeil) \ | 6219 V(Math, ceil, MathCeil) \ |
(...skipping 14 matching lines...) Expand all Loading... |
6237 V(Math, imul, MathImul) | 6234 V(Math, imul, MathImul) |
6238 | 6235 |
6239 enum BuiltinFunctionId { | 6236 enum BuiltinFunctionId { |
6240 kArrayCode, | 6237 kArrayCode, |
6241 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \ | 6238 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \ |
6242 k##name, | 6239 k##name, |
6243 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) | 6240 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) |
6244 #undef DECLARE_FUNCTION_ID | 6241 #undef DECLARE_FUNCTION_ID |
6245 // Fake id for a special case of Math.pow. Note, it continues the | 6242 // Fake id for a special case of Math.pow. Note, it continues the |
6246 // list of math functions. | 6243 // list of math functions. |
6247 kMathPowHalf, | 6244 kMathPowHalf |
6248 kFirstMathFunctionId = kMathFloor | |
6249 }; | 6245 }; |
6250 | 6246 |
6251 | 6247 |
6252 // SharedFunctionInfo describes the JSFunction information that can be | 6248 // SharedFunctionInfo describes the JSFunction information that can be |
6253 // shared by multiple instances of the function. | 6249 // shared by multiple instances of the function. |
6254 class SharedFunctionInfo: public HeapObject { | 6250 class SharedFunctionInfo: public HeapObject { |
6255 public: | 6251 public: |
6256 // [name]: Function name. | 6252 // [name]: Function name. |
6257 DECL_ACCESSORS(name, Object) | 6253 DECL_ACCESSORS(name, Object) |
6258 | 6254 |
(...skipping 3978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10237 } else { | 10233 } else { |
10238 value &= ~(1 << bit_position); | 10234 value &= ~(1 << bit_position); |
10239 } | 10235 } |
10240 return value; | 10236 return value; |
10241 } | 10237 } |
10242 }; | 10238 }; |
10243 | 10239 |
10244 } } // namespace v8::internal | 10240 } } // namespace v8::internal |
10245 | 10241 |
10246 #endif // V8_OBJECTS_H_ | 10242 #endif // V8_OBJECTS_H_ |
OLD | NEW |