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

Side by Side Diff: src/objects.h

Issue 23691056: Handle non-JSObject heap objects using slow-path IC stub guarded by the map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/ic.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 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 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 static void VerifyHeapPointer(Object* p); 1783 static void VerifyHeapPointer(Object* p);
1784 #endif 1784 #endif
1785 1785
1786 // Layout description. 1786 // Layout description.
1787 // First field in a heap object is map. 1787 // First field in a heap object is map.
1788 static const int kMapOffset = Object::kHeaderSize; 1788 static const int kMapOffset = Object::kHeaderSize;
1789 static const int kHeaderSize = kMapOffset + kPointerSize; 1789 static const int kHeaderSize = kMapOffset + kPointerSize;
1790 1790
1791 STATIC_CHECK(kMapOffset == Internals::kHeapObjectMapOffset); 1791 STATIC_CHECK(kMapOffset == Internals::kHeapObjectMapOffset);
1792 1792
1793 static void UpdateMapCodeCache(Handle<HeapObject> object,
Michael Starzinger 2013/09/12 14:28:48 Please move this up a few lines to above the casti
Toon Verwaest 2013/09/12 14:58:23 Done.
1794 Handle<Name> name,
1795 Handle<Code> code);
1796
1793 protected: 1797 protected:
1794 // helpers for calling an ObjectVisitor to iterate over pointers in the 1798 // helpers for calling an ObjectVisitor to iterate over pointers in the
1795 // half-open range [start, end) specified as integer offsets 1799 // half-open range [start, end) specified as integer offsets
1796 inline void IteratePointers(ObjectVisitor* v, int start, int end); 1800 inline void IteratePointers(ObjectVisitor* v, int start, int end);
1797 // as above, for the single element at "offset" 1801 // as above, for the single element at "offset"
1798 inline void IteratePointer(ObjectVisitor* v, int offset); 1802 inline void IteratePointer(ObjectVisitor* v, int offset);
1799 1803
1800 private: 1804 private:
1801 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapObject); 1805 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapObject);
1802 }; 1806 };
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 PropertyNormalizationMode mode, 2571 PropertyNormalizationMode mode,
2568 int expected_additional_properties); 2572 int expected_additional_properties);
2569 2573
2570 // Convert and update the elements backing store to be a 2574 // Convert and update the elements backing store to be a
2571 // SeededNumberDictionary dictionary. Returns the backing after conversion. 2575 // SeededNumberDictionary dictionary. Returns the backing after conversion.
2572 static Handle<SeededNumberDictionary> NormalizeElements( 2576 static Handle<SeededNumberDictionary> NormalizeElements(
2573 Handle<JSObject> object); 2577 Handle<JSObject> object);
2574 2578
2575 MUST_USE_RESULT MaybeObject* NormalizeElements(); 2579 MUST_USE_RESULT MaybeObject* NormalizeElements();
2576 2580
2577 static void UpdateMapCodeCache(Handle<JSObject> object,
2578 Handle<Name> name,
2579 Handle<Code> code);
2580
2581 // Transform slow named properties to fast variants. 2581 // Transform slow named properties to fast variants.
2582 // Returns failure if allocation failed. 2582 // Returns failure if allocation failed.
2583 static void TransformToFastProperties(Handle<JSObject> object, 2583 static void TransformToFastProperties(Handle<JSObject> object,
2584 int unused_property_fields); 2584 int unused_property_fields);
2585 2585
2586 MUST_USE_RESULT MaybeObject* TransformToFastProperties( 2586 MUST_USE_RESULT MaybeObject* TransformToFastProperties(
2587 int unused_property_fields); 2587 int unused_property_fields);
2588 2588
2589 // Access fast-case object properties at index. 2589 // Access fast-case object properties at index.
2590 MUST_USE_RESULT inline MaybeObject* FastPropertyAt( 2590 MUST_USE_RESULT inline MaybeObject* FastPropertyAt(
(...skipping 2894 matching lines...) Expand 10 before | Expand all | Expand 10 after
5485 // Tells whether the instance is undetectable. 5485 // Tells whether the instance is undetectable.
5486 // An undetectable object is a special class of JSObject: 'typeof' operator 5486 // An undetectable object is a special class of JSObject: 'typeof' operator
5487 // returns undefined, ToBoolean returns false. Otherwise it behaves like 5487 // returns undefined, ToBoolean returns false. Otherwise it behaves like
5488 // a normal JS object. It is useful for implementing undetectable 5488 // a normal JS object. It is useful for implementing undetectable
5489 // document.all in Firefox & Safari. 5489 // document.all in Firefox & Safari.
5490 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549. 5490 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549.
5491 inline void set_is_undetectable() { 5491 inline void set_is_undetectable() {
5492 set_bit_field(bit_field() | (1 << kIsUndetectable)); 5492 set_bit_field(bit_field() | (1 << kIsUndetectable));
5493 } 5493 }
5494 5494
5495 inline bool is_jsobject_map();
Michael Starzinger 2013/09/12 14:28:48 I think starting to duplicate type checking predic
Toon Verwaest 2013/09/12 14:58:23 Done.
5496
5495 inline bool is_undetectable() { 5497 inline bool is_undetectable() {
5496 return ((1 << kIsUndetectable) & bit_field()) != 0; 5498 return ((1 << kIsUndetectable) & bit_field()) != 0;
5497 } 5499 }
5498 5500
5499 // Tells whether the instance has a call-as-function handler. 5501 // Tells whether the instance has a call-as-function handler.
5500 inline void set_has_instance_call_handler() { 5502 inline void set_has_instance_call_handler() {
5501 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler)); 5503 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler));
5502 } 5504 }
5503 5505
5504 inline bool has_instance_call_handler() { 5506 inline bool has_instance_call_handler() {
(...skipping 4719 matching lines...) Expand 10 before | Expand all | Expand 10 after
10224 } else { 10226 } else {
10225 value &= ~(1 << bit_position); 10227 value &= ~(1 << bit_position);
10226 } 10228 }
10227 return value; 10229 return value;
10228 } 10230 }
10229 }; 10231 };
10230 10232
10231 } } // namespace v8::internal 10233 } } // namespace v8::internal
10232 10234
10233 #endif // V8_OBJECTS_H_ 10235 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698