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

Side by Side Diff: src/objects.h

Issue 2151163002: [stubs] Improve code generation for ToBoolean. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Fix redness. Created 4 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
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | src/objects.cc » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/assert-scope.h" 10 #include "src/assert-scope.h"
(...skipping 9610 matching lines...) Expand 10 before | Expand all | Expand 10 after
9621 // [to_number_raw]: Cached raw to_number computed at startup. 9621 // [to_number_raw]: Cached raw to_number computed at startup.
9622 inline double to_number_raw() const; 9622 inline double to_number_raw() const;
9623 inline void set_to_number_raw(double value); 9623 inline void set_to_number_raw(double value);
9624 9624
9625 // [to_string]: Cached to_string computed at startup. 9625 // [to_string]: Cached to_string computed at startup.
9626 DECL_ACCESSORS(to_string, String) 9626 DECL_ACCESSORS(to_string, String)
9627 9627
9628 // [to_number]: Cached to_number computed at startup. 9628 // [to_number]: Cached to_number computed at startup.
9629 DECL_ACCESSORS(to_number, Object) 9629 DECL_ACCESSORS(to_number, Object)
9630 9630
9631 // [to_number]: Cached to_boolean computed at startup.
9632 DECL_ACCESSORS(to_boolean, Oddball)
9633
9634 // [typeof]: Cached type_of computed at startup. 9631 // [typeof]: Cached type_of computed at startup.
9635 DECL_ACCESSORS(type_of, String) 9632 DECL_ACCESSORS(type_of, String)
9636 9633
9637 inline byte kind() const; 9634 inline byte kind() const;
9638 inline void set_kind(byte kind); 9635 inline void set_kind(byte kind);
9639 9636
9640 // ES6 section 7.1.3 ToNumber for Boolean, Null, Undefined. 9637 // ES6 section 7.1.3 ToNumber for Boolean, Null, Undefined.
9641 MUST_USE_RESULT static inline Handle<Object> ToNumber(Handle<Oddball> input); 9638 MUST_USE_RESULT static inline Handle<Object> ToNumber(Handle<Oddball> input);
9642 9639
9643 DECLARE_CAST(Oddball) 9640 DECLARE_CAST(Oddball)
9644 9641
9645 // Dispatched behavior. 9642 // Dispatched behavior.
9646 DECLARE_VERIFIER(Oddball) 9643 DECLARE_VERIFIER(Oddball)
9647 9644
9648 // Initialize the fields. 9645 // Initialize the fields.
9649 static void Initialize(Isolate* isolate, Handle<Oddball> oddball, 9646 static void Initialize(Isolate* isolate, Handle<Oddball> oddball,
9650 const char* to_string, Handle<Object> to_number, 9647 const char* to_string, Handle<Object> to_number,
9651 bool to_boolean, const char* type_of, byte kind); 9648 const char* type_of, byte kind);
9652 9649
9653 // Layout description. 9650 // Layout description.
9654 static const int kToNumberRawOffset = HeapObject::kHeaderSize; 9651 static const int kToNumberRawOffset = HeapObject::kHeaderSize;
9655 static const int kToStringOffset = kToNumberRawOffset + kDoubleSize; 9652 static const int kToStringOffset = kToNumberRawOffset + kDoubleSize;
9656 static const int kToNumberOffset = kToStringOffset + kPointerSize; 9653 static const int kToNumberOffset = kToStringOffset + kPointerSize;
9657 static const int kToBooleanOffset = kToNumberOffset + kPointerSize; 9654 static const int kTypeOfOffset = kToNumberOffset + kPointerSize;
9658 static const int kTypeOfOffset = kToBooleanOffset + kPointerSize;
9659 static const int kKindOffset = kTypeOfOffset + kPointerSize; 9655 static const int kKindOffset = kTypeOfOffset + kPointerSize;
9660 static const int kSize = kKindOffset + kPointerSize; 9656 static const int kSize = kKindOffset + kPointerSize;
9661 9657
9662 static const byte kFalse = 0; 9658 static const byte kFalse = 0;
9663 static const byte kTrue = 1; 9659 static const byte kTrue = 1;
9664 static const byte kNotBooleanMask = ~1; 9660 static const byte kNotBooleanMask = ~1;
9665 static const byte kTheHole = 2; 9661 static const byte kTheHole = 2;
9666 static const byte kNull = 3; 9662 static const byte kNull = 3;
9667 static const byte kArgumentsMarker = 4; 9663 static const byte kArgumentsMarker = 4;
9668 static const byte kUndefined = 5; 9664 static const byte kUndefined = 5;
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
10993 } 10989 }
10994 return value; 10990 return value;
10995 } 10991 }
10996 }; 10992 };
10997 10993
10998 10994
10999 } // NOLINT, false-positive due to second-order macros. 10995 } // NOLINT, false-positive due to second-order macros.
11000 } // NOLINT, false-positive due to second-order macros. 10996 } // NOLINT, false-positive due to second-order macros.
11001 10997
11002 #endif // V8_OBJECTS_H_ 10998 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698