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

Side by Side Diff: src/builtins.cc

Issue 6717018: Introduce accessors on builtins instance (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix tests and lint. Created 9 years, 9 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/builtins.h ('k') | src/compiler.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 functions->s_name = #aname; \ 1569 functions->s_name = #aname; \
1570 functions->name = c_##aname; \ 1570 functions->name = c_##aname; \
1571 functions->flags = Code::ComputeFlags(Code::BUILTIN); \ 1571 functions->flags = Code::ComputeFlags(Code::BUILTIN); \
1572 functions->extra_args = aextra_args; \ 1572 functions->extra_args = aextra_args; \
1573 ++functions; 1573 ++functions;
1574 1574
1575 #define DEF_FUNCTION_PTR_A(aname, kind, state, extra) \ 1575 #define DEF_FUNCTION_PTR_A(aname, kind, state, extra) \
1576 functions->generator = FUNCTION_ADDR(Generate_##aname); \ 1576 functions->generator = FUNCTION_ADDR(Generate_##aname); \
1577 functions->c_code = NULL; \ 1577 functions->c_code = NULL; \
1578 functions->s_name = #aname; \ 1578 functions->s_name = #aname; \
1579 functions->name = aname; \ 1579 functions->name = k##aname; \
1580 functions->flags = Code::ComputeFlags(Code::kind, \ 1580 functions->flags = Code::ComputeFlags(Code::kind, \
1581 NOT_IN_LOOP, \ 1581 NOT_IN_LOOP, \
1582 state, \ 1582 state, \
1583 extra); \ 1583 extra); \
1584 functions->extra_args = NO_EXTRA_ARGUMENTS; \ 1584 functions->extra_args = NO_EXTRA_ARGUMENTS; \
1585 ++functions; 1585 ++functions;
1586 1586
1587 BUILTIN_LIST_C(DEF_FUNCTION_PTR_C) 1587 BUILTIN_LIST_C(DEF_FUNCTION_PTR_C)
1588 BUILTIN_LIST_A(DEF_FUNCTION_PTR_A) 1588 BUILTIN_LIST_A(DEF_FUNCTION_PTR_A)
1589 BUILTIN_LIST_DEBUG_A(DEF_FUNCTION_PTR_A) 1589 BUILTIN_LIST_DEBUG_A(DEF_FUNCTION_PTR_A)
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 Code* entry = Code::cast(builtins_[i]); 1678 Code* entry = Code::cast(builtins_[i]);
1679 if (entry->contains(pc)) { 1679 if (entry->contains(pc)) {
1680 return names_[i]; 1680 return names_[i];
1681 } 1681 }
1682 } 1682 }
1683 } 1683 }
1684 return NULL; 1684 return NULL;
1685 } 1685 }
1686 1686
1687 1687
1688 #define DEFINE_BUILTIN_ACCESSOR_C(name, ignore) \
1689 Handle<Code> Builtins::name() { \
1690 Code** code_address = \
1691 reinterpret_cast<Code**>(builtin_address(k##name)); \
1692 return Handle<Code>(code_address); \
1693 }
1694 #define DEFINE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \
1695 Handle<Code> Builtins::name() { \
1696 Code** code_address = \
1697 reinterpret_cast<Code**>(builtin_address(k##name)); \
1698 return Handle<Code>(code_address); \
1699 }
1700 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1701 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1702 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1703 #undef DEFINE_BUILTIN_ACCESSOR_C
1704 #undef DEFINE_BUILTIN_ACCESSOR_A
1705
1706
1688 } } // namespace v8::internal 1707 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698