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

Unified Diff: src/code-stubs.cc

Issue 8883023: Revert 10216 Optimize the equality check case of ICCompare stubs. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years 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/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
===================================================================
--- src/code-stubs.cc (revision 10216)
+++ src/code-stubs.cc (working copy)
@@ -101,14 +101,7 @@
Factory* factory = isolate->factory();
Heap* heap = isolate->heap();
Code* code;
- if (UseSpecialCache()
- ? FindCodeInSpecialCache(&code)
- : FindCodeInCache(&code)) {
- ASSERT(IsPregenerated() == code->is_pregenerated());
- return Handle<Code>(code);
- }
-
- {
+ if (!FindCodeInCache(&code)) {
HandleScope scope(isolate);
// Generate the new code.
@@ -128,21 +121,19 @@
RecordCodeGeneration(*new_object, &masm);
FinishCode(new_object);
- if (UseSpecialCache()) {
- AddToSpecialCache(new_object);
- } else {
- // Update the dictionary and the root in Heap.
- Handle<NumberDictionary> dict =
- factory->DictionaryAtNumberPut(
- Handle<NumberDictionary>(heap->code_stubs()),
- GetKey(),
- new_object);
- heap->public_set_code_stubs(*dict);
- }
+ // Update the dictionary and the root in Heap.
+ Handle<NumberDictionary> dict =
+ factory->DictionaryAtNumberPut(
+ Handle<NumberDictionary>(heap->code_stubs()),
+ GetKey(),
+ new_object);
+ heap->public_set_code_stubs(*dict);
code = *new_object;
+ Activate(code);
+ } else {
+ CHECK(IsPregenerated() == code->is_pregenerated());
}
- Activate(code);
ASSERT(!NeedsImmovableCode() || heap->lo_space()->Contains(code));
return Handle<Code>(code, isolate);
}
@@ -168,32 +159,6 @@
}
-void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) {
- ASSERT(*known_map_ != NULL);
- Isolate* isolate = new_object->GetIsolate();
- Factory* factory = isolate->factory();
- return Map::UpdateCodeCache(known_map_,
- factory->compare_ic_symbol(),
- new_object);
-}
-
-
-bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) {
- Isolate* isolate = known_map_->GetIsolate();
- Factory* factory = isolate->factory();
- Code::Flags flags = Code::ComputeFlags(
- static_cast<Code::Kind>(GetCodeKind()),
- UNINITIALIZED);
- Handle<Object> probe(
- known_map_->FindInCodeCache(*factory->compare_ic_symbol(), flags));
- if (probe->IsCode()) {
- *code_out = Code::cast(*probe);
- return true;
- }
- return false;
-}
-
-
int ICCompareStub::MinorKey() {
return OpField::encode(op_ - Token::EQ) | StateField::encode(state_);
}
@@ -219,10 +184,6 @@
case CompareIC::OBJECTS:
GenerateObjects(masm);
break;
- case CompareIC::KNOWN_OBJECTS:
- ASSERT(*known_map_ != NULL);
- GenerateKnownObjects(masm);
- break;
default:
UNREACHABLE();
}
« no previous file with comments | « src/code-stubs.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698