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

Side by Side Diff: src/objects.h

Issue 394833002: Ship ES6 Math functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/math.js ('k') | test/mjsunit/es6/math-cbrt.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assert-scope.h" 9 #include "src/assert-scope.h"
10 #include "src/builtins.h" 10 #include "src/builtins.h"
(...skipping 6997 matching lines...) Expand 10 before | Expand all | Expand 10 after
7008 7008
7009 // List of builtin functions we want to identify to improve code 7009 // List of builtin functions we want to identify to improve code
7010 // generation. 7010 // generation.
7011 // 7011 //
7012 // Each entry has a name of a global object property holding an object 7012 // Each entry has a name of a global object property holding an object
7013 // optionally followed by ".prototype", a name of a builtin function 7013 // optionally followed by ".prototype", a name of a builtin function
7014 // on the object (the one the id is set for), and a label. 7014 // on the object (the one the id is set for), and a label.
7015 // 7015 //
7016 // Installation of ids for the selected builtin functions is handled 7016 // Installation of ids for the selected builtin functions is handled
7017 // by the bootstrapper. 7017 // by the bootstrapper.
7018 #define FUNCTIONS_WITH_ID_LIST(V) \ 7018 #define FUNCTIONS_WITH_ID_LIST(V) \
7019 V(Array.prototype, indexOf, ArrayIndexOf) \ 7019 V(Array.prototype, indexOf, ArrayIndexOf) \
7020 V(Array.prototype, lastIndexOf, ArrayLastIndexOf) \ 7020 V(Array.prototype, lastIndexOf, ArrayLastIndexOf) \
7021 V(Array.prototype, push, ArrayPush) \ 7021 V(Array.prototype, push, ArrayPush) \
7022 V(Array.prototype, pop, ArrayPop) \ 7022 V(Array.prototype, pop, ArrayPop) \
7023 V(Array.prototype, shift, ArrayShift) \ 7023 V(Array.prototype, shift, ArrayShift) \
7024 V(Function.prototype, apply, FunctionApply) \ 7024 V(Function.prototype, apply, FunctionApply) \
7025 V(String.prototype, charCodeAt, StringCharCodeAt) \ 7025 V(String.prototype, charCodeAt, StringCharCodeAt) \
7026 V(String.prototype, charAt, StringCharAt) \ 7026 V(String.prototype, charAt, StringCharAt) \
7027 V(String, fromCharCode, StringFromCharCode) \ 7027 V(String, fromCharCode, StringFromCharCode) \
7028 V(Math, floor, MathFloor) \ 7028 V(Math, floor, MathFloor) \
7029 V(Math, round, MathRound) \ 7029 V(Math, round, MathRound) \
7030 V(Math, ceil, MathCeil) \ 7030 V(Math, ceil, MathCeil) \
7031 V(Math, abs, MathAbs) \ 7031 V(Math, abs, MathAbs) \
7032 V(Math, log, MathLog) \ 7032 V(Math, log, MathLog) \
7033 V(Math, exp, MathExp) \ 7033 V(Math, exp, MathExp) \
7034 V(Math, sqrt, MathSqrt) \ 7034 V(Math, sqrt, MathSqrt) \
7035 V(Math, pow, MathPow) \ 7035 V(Math, pow, MathPow) \
7036 V(Math, max, MathMax) \ 7036 V(Math, max, MathMax) \
7037 V(Math, min, MathMin) \ 7037 V(Math, min, MathMin) \
7038 V(Math, imul, MathImul) 7038 V(Math, imul, MathImul) \
7039 V(Math, clz32, MathClz32)
7039 7040
7040 enum BuiltinFunctionId { 7041 enum BuiltinFunctionId {
7041 kArrayCode, 7042 kArrayCode,
7042 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \ 7043 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \
7043 k##name, 7044 k##name,
7044 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) 7045 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID)
7045 #undef DECLARE_FUNCTION_ID 7046 #undef DECLARE_FUNCTION_ID
7046 // Fake id for a special case of Math.pow. Note, it continues the 7047 // Fake id for a special case of Math.pow. Note, it continues the
7047 // list of math functions. 7048 // list of math functions.
7048 kMathPowHalf, 7049 kMathPowHalf
7049 // Installed only on --harmony-maths.
7050 kMathClz32
7051 }; 7050 };
7052 7051
7053 7052
7054 // SharedFunctionInfo describes the JSFunction information that can be 7053 // SharedFunctionInfo describes the JSFunction information that can be
7055 // shared by multiple instances of the function. 7054 // shared by multiple instances of the function.
7056 class SharedFunctionInfo: public HeapObject { 7055 class SharedFunctionInfo: public HeapObject {
7057 public: 7056 public:
7058 // [name]: Function name. 7057 // [name]: Function name.
7059 DECL_ACCESSORS(name, Object) 7058 DECL_ACCESSORS(name, Object)
7060 7059
(...skipping 4166 matching lines...) Expand 10 before | Expand all | Expand 10 after
11227 } else { 11226 } else {
11228 value &= ~(1 << bit_position); 11227 value &= ~(1 << bit_position);
11229 } 11228 }
11230 return value; 11229 return value;
11231 } 11230 }
11232 }; 11231 };
11233 11232
11234 } } // namespace v8::internal 11233 } } // namespace v8::internal
11235 11234
11236 #endif // V8_OBJECTS_H_ 11235 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/math.js ('k') | test/mjsunit/es6/math-cbrt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698