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

Side by Side Diff: src/objects.h

Issue 952303002: Remove NativeContext from Literal array, since we always create the literals in the native context … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 years, 10 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/liveedit.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 // 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/allocation.h" 10 #include "src/allocation.h"
(...skipping 7555 matching lines...) Expand 10 before | Expand all | Expand 10 after
7566 // through pointers to the first instruction in the code object. 7566 // through pointers to the first instruction in the code object.
7567 void JSFunctionIterateBody(int object_size, ObjectVisitor* v); 7567 void JSFunctionIterateBody(int object_size, ObjectVisitor* v);
7568 7568
7569 // Dispatched behavior. 7569 // Dispatched behavior.
7570 DECLARE_PRINTER(JSFunction) 7570 DECLARE_PRINTER(JSFunction)
7571 DECLARE_VERIFIER(JSFunction) 7571 DECLARE_VERIFIER(JSFunction)
7572 7572
7573 // Returns the number of allocated literals. 7573 // Returns the number of allocated literals.
7574 inline int NumberOfLiterals(); 7574 inline int NumberOfLiterals();
7575 7575
7576 // Retrieve the native context from a function's literal array.
7577 static Context* NativeContextFromLiterals(FixedArray* literals);
7578
7579 // Used for flags such as --hydrogen-filter. 7576 // Used for flags such as --hydrogen-filter.
7580 bool PassesFilter(const char* raw_filter); 7577 bool PassesFilter(const char* raw_filter);
7581 7578
7582 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to 7579 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to
7583 // kSize) is weak and has special handling during garbage collection. 7580 // kSize) is weak and has special handling during garbage collection.
7584 static const int kCodeEntryOffset = JSObject::kHeaderSize; 7581 static const int kCodeEntryOffset = JSObject::kHeaderSize;
7585 static const int kPrototypeOrInitialMapOffset = 7582 static const int kPrototypeOrInitialMapOffset =
7586 kCodeEntryOffset + kPointerSize; 7583 kCodeEntryOffset + kPointerSize;
7587 static const int kSharedFunctionInfoOffset = 7584 static const int kSharedFunctionInfoOffset =
7588 kPrototypeOrInitialMapOffset + kPointerSize; 7585 kPrototypeOrInitialMapOffset + kPointerSize;
7589 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize; 7586 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize;
7590 static const int kLiteralsOffset = kContextOffset + kPointerSize; 7587 static const int kLiteralsOffset = kContextOffset + kPointerSize;
7591 static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize; 7588 static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize;
7592 static const int kNextFunctionLinkOffset = kNonWeakFieldsEndOffset; 7589 static const int kNextFunctionLinkOffset = kNonWeakFieldsEndOffset;
7593 static const int kSize = kNextFunctionLinkOffset + kPointerSize; 7590 static const int kSize = kNextFunctionLinkOffset + kPointerSize;
7594 7591
7595 // Layout of the literals array.
7596 static const int kLiteralsPrefixSize = 1;
7597 static const int kLiteralNativeContextIndex = 0;
7598
7599 // Layout of the bound-function binding array. 7592 // Layout of the bound-function binding array.
7600 static const int kBoundFunctionIndex = 0; 7593 static const int kBoundFunctionIndex = 0;
7601 static const int kBoundThisIndex = 1; 7594 static const int kBoundThisIndex = 1;
7602 static const int kBoundArgumentsStartIndex = 2; 7595 static const int kBoundArgumentsStartIndex = 2;
7603 7596
7604 private: 7597 private:
7605 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunction); 7598 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunction);
7606 }; 7599 };
7607 7600
7608 7601
(...skipping 3376 matching lines...) Expand 10 before | Expand all | Expand 10 after
10985 } else { 10978 } else {
10986 value &= ~(1 << bit_position); 10979 value &= ~(1 << bit_position);
10987 } 10980 }
10988 return value; 10981 return value;
10989 } 10982 }
10990 }; 10983 };
10991 10984
10992 } } // namespace v8::internal 10985 } } // namespace v8::internal
10993 10986
10994 #endif // V8_OBJECTS_H_ 10987 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698