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

Side by Side Diff: src/stub-cache.cc

Issue 7227010: Create and use shared stub for for DictionaryValue-based elements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: more arm fixes Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/ic-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 Code::cast(result->ToObjectUnchecked()), 1679 Code::cast(result->ToObjectUnchecked()),
1680 name)); 1680 name));
1681 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, 1681 GDBJIT(AddCode(GDBJITInterface::LOAD_IC,
1682 name, 1682 name,
1683 Code::cast(result->ToObjectUnchecked()))); 1683 Code::cast(result->ToObjectUnchecked())));
1684 } 1684 }
1685 return result; 1685 return result;
1686 } 1686 }
1687 1687
1688 1688
1689 MaybeObject* KeyedLoadStubCompiler::ComputeSharedKeyedLoadElementStub(
1690 Map* receiver_map) {
1691 MaybeObject* maybe_stub = NULL;
1692 if (receiver_map->has_fast_elements()) {
1693 maybe_stub = KeyedLoadFastElementStub().TryGetCode();
1694 } else if (receiver_map->has_external_array_elements()) {
1695 JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
1696 maybe_stub = KeyedLoadExternalArrayStub(elements_kind).TryGetCode();
1697 } else if (receiver_map->has_dictionary_elements()) {
1698 maybe_stub = isolate()->builtins()->builtin(Builtins::kKeyedLoadIC_Slow);
1699 } else {
1700 UNREACHABLE();
1701 }
1702 return maybe_stub;
1703 }
1704
1705
1706 MaybeObject* StoreStubCompiler::GetCode(PropertyType type, String* name) { 1689 MaybeObject* StoreStubCompiler::GetCode(PropertyType type, String* name) {
1707 Code::Flags flags = Code::ComputeMonomorphicFlags( 1690 Code::Flags flags = Code::ComputeMonomorphicFlags(
1708 Code::STORE_IC, type, strict_mode_); 1691 Code::STORE_IC, type, strict_mode_);
1709 MaybeObject* result = GetCodeWithFlags(flags, name); 1692 MaybeObject* result = GetCodeWithFlags(flags, name);
1710 if (!result->IsFailure()) { 1693 if (!result->IsFailure()) {
1711 PROFILE(isolate(), 1694 PROFILE(isolate(),
1712 CodeCreateEvent(Logger::STORE_IC_TAG, 1695 CodeCreateEvent(Logger::STORE_IC_TAG,
1713 Code::cast(result->ToObjectUnchecked()), 1696 Code::cast(result->ToObjectUnchecked()),
1714 name)); 1697 name));
1715 GDBJIT(AddCode(GDBJITInterface::STORE_IC, 1698 GDBJIT(AddCode(GDBJITInterface::STORE_IC,
(...skipping 16 matching lines...) Expand all
1732 Code::cast(result->ToObjectUnchecked()), 1715 Code::cast(result->ToObjectUnchecked()),
1733 name)); 1716 name));
1734 GDBJIT(AddCode(GDBJITInterface::KEYED_STORE_IC, 1717 GDBJIT(AddCode(GDBJITInterface::KEYED_STORE_IC,
1735 name, 1718 name,
1736 Code::cast(result->ToObjectUnchecked()))); 1719 Code::cast(result->ToObjectUnchecked())));
1737 } 1720 }
1738 return result; 1721 return result;
1739 } 1722 }
1740 1723
1741 1724
1742 MaybeObject* KeyedStoreStubCompiler::ComputeSharedKeyedStoreElementStub( 1725 void KeyedStoreStubCompiler::GenerateStoreDictionaryElement(
1743 Map* receiver_map) { 1726 MacroAssembler* masm) {
1744 MaybeObject* maybe_stub = NULL; 1727 KeyedStoreIC::GenerateSlow(masm);
1745 if (receiver_map->has_fast_elements()) {
1746 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
1747 maybe_stub = KeyedStoreFastElementStub(is_js_array).TryGetCode();
1748 } else if (receiver_map->has_external_array_elements()) {
1749 JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
1750 maybe_stub = KeyedStoreExternalArrayStub(elements_kind).TryGetCode();
1751 } else if (receiver_map->has_dictionary_elements()) {
1752 maybe_stub = isolate()->builtins()->builtin(Builtins::kKeyedStoreIC_Slow);
1753 } else {
1754 UNREACHABLE();
1755 }
1756 return maybe_stub;
1757 } 1728 }
1758 1729
1759 1730
1760 CallStubCompiler::CallStubCompiler(int argc, 1731 CallStubCompiler::CallStubCompiler(int argc,
1761 InLoopFlag in_loop, 1732 InLoopFlag in_loop,
1762 Code::Kind kind, 1733 Code::Kind kind,
1763 Code::ExtraICState extra_ic_state, 1734 Code::ExtraICState extra_ic_state,
1764 InlineCacheHolderFlag cache_holder) 1735 InlineCacheHolderFlag cache_holder)
1765 : arguments_(argc), 1736 : arguments_(argc),
1766 in_loop_(in_loop), 1737 in_loop_(in_loop),
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 expected_receiver_type_ = 1885 expected_receiver_type_ =
1915 FunctionTemplateInfo::cast(signature->receiver()); 1886 FunctionTemplateInfo::cast(signature->receiver());
1916 } 1887 }
1917 } 1888 }
1918 1889
1919 is_simple_api_call_ = true; 1890 is_simple_api_call_ = true;
1920 } 1891 }
1921 1892
1922 1893
1923 } } // namespace v8::internal 1894 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698