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

Unified Diff: src/objects.h

Issue 1638006: One less dependent load in InvokeBuiltin. (Closed)
Patch Set: . Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 9197466e85e4564cfe29e38e814e4865e5c06a64..b6e037c475ff3dea7aeb372264f74450f28c1529 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -3525,6 +3525,10 @@ class JSBuiltinsObject: public GlobalObject {
inline Object* javascript_builtin(Builtins::JavaScript id);
inline void set_javascript_builtin(Builtins::JavaScript id, Object* value);
+ // Accessors for code of the runtime routines written in JavaScript.
+ inline Code* javascript_builtin_code(Builtins::JavaScript id);
+ inline void set_javascript_builtin_code(Builtins::JavaScript id, Code* value);
+
// Casting.
static inline JSBuiltinsObject* cast(Object* obj);
@@ -3535,11 +3539,23 @@ class JSBuiltinsObject: public GlobalObject {
#endif
// Layout description. The size of the builtins object includes
- // room for one pointer per runtime routine written in javascript.
+ // room for two pointers per runtime routine written in javascript
+ // (function and code object).
static const int kJSBuiltinsCount = Builtins::id_count;
static const int kJSBuiltinsOffset = GlobalObject::kHeaderSize;
+ static const int kJSBuiltinsCodeOffset =
+ GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize);
static const int kSize =
- kJSBuiltinsOffset + (kJSBuiltinsCount * kPointerSize);
+ kJSBuiltinsCodeOffset + (kJSBuiltinsCount * kPointerSize);
+
+ static int OffsetOfFunctionWithId(Builtins::JavaScript id) {
+ return kJSBuiltinsOffset + id * kPointerSize;
+ }
+
+ static int OffsetOfCodeWithId(Builtins::JavaScript id) {
+ return kJSBuiltinsCodeOffset + id * kPointerSize;
+ }
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(JSBuiltinsObject);
};
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698