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

Unified Diff: src/code-stubs.cc

Issue 1846963002: Use a dictionary-mode code cache on the map rather than a dual system. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 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/code-stubs.h ('k') | src/disassembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 60b350cd93b22c702053057d0cbfb0bdf572e844..4def8c61e987901e7b25d2fa3bf0df00e267ec3b 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -99,8 +99,7 @@ Code::Kind CodeStub::GetCodeKind() const {
Code::Flags CodeStub::GetCodeFlags() const {
- return Code::ComputeFlags(GetCodeKind(), GetICState(), GetExtraICState(),
- GetStubType());
+ return Code::ComputeFlags(GetCodeKind(), GetICState(), GetExtraICState());
}
@@ -135,11 +134,8 @@ Handle<Code> PlatformCodeStub::GenerateCode() {
CodeDesc desc;
masm.GetCode(&desc);
// Copy the generated code into a heap object.
- Code::Flags flags = Code::ComputeFlags(
- GetCodeKind(),
- GetICState(),
- GetExtraICState(),
- GetStubType());
+ Code::Flags flags =
+ Code::ComputeFlags(GetCodeKind(), GetICState(), GetExtraICState());
Handle<Code> new_object = factory->NewCode(
desc, flags, masm.CodeObject(), NeedsImmovableCode());
return new_object;
@@ -390,19 +386,14 @@ void CompareICStub::AddToSpecialCache(Handle<Code> new_object) {
bool CompareICStub::FindCodeInSpecialCache(Code** code_out) {
- Factory* factory = isolate()->factory();
Code::Flags flags = Code::ComputeFlags(
GetCodeKind(),
UNINITIALIZED);
- Handle<Object> probe(
- known_map_->FindInCodeCache(
- strict() ?
- *factory->strict_compare_ic_string() :
- *factory->compare_ic_string(),
- flags),
- isolate());
- if (probe->IsCode()) {
- *code_out = Code::cast(*probe);
+ Name* name = strict() ? isolate()->heap()->strict_compare_ic_string()
+ : isolate()->heap()->compare_ic_string();
+ Code* code = known_map_->LookupInCodeCache(name, flags);
+ if (code != nullptr) {
+ *code_out = code;
#ifdef DEBUG
CompareICStub decode((*code_out)->stub_key(), isolate());
DCHECK(op() == decode.op());
« no previous file with comments | « src/code-stubs.h ('k') | src/disassembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698