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

Side by Side Diff: src/code-stubs.cc

Issue 10830334: Fix bug in compare IC. BUG=2291 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 4 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 | « no previous file | src/heap.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 void CodeStub::PrintName(StringStream* stream) { 165 void CodeStub::PrintName(StringStream* stream) {
166 stream->Add("%s", MajorName(MajorKey(), false)); 166 stream->Add("%s", MajorName(MajorKey(), false));
167 } 167 }
168 168
169 169
170 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) { 170 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) {
171 ASSERT(*known_map_ != NULL); 171 ASSERT(*known_map_ != NULL);
172 Isolate* isolate = new_object->GetIsolate(); 172 Isolate* isolate = new_object->GetIsolate();
173 Factory* factory = isolate->factory(); 173 Factory* factory = isolate->factory();
174 return Map::UpdateCodeCache(known_map_, 174 return Map::UpdateCodeCache(known_map_,
175 factory->compare_ic_symbol(), 175 strict() ?
176 factory->strict_compare_ic_symbol() :
177 factory->compare_ic_symbol(),
176 new_object); 178 new_object);
177 } 179 }
178 180
179 181
180 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) { 182 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) {
181 Isolate* isolate = known_map_->GetIsolate(); 183 Isolate* isolate = known_map_->GetIsolate();
Vyacheslav Egorov (Google) 2012/08/15 14:24:30 I would add an assertion here and in AddToSpecialC
182 Factory* factory = isolate->factory(); 184 Factory* factory = isolate->factory();
183 Code::Flags flags = Code::ComputeFlags( 185 Code::Flags flags = Code::ComputeFlags(
184 static_cast<Code::Kind>(GetCodeKind()), 186 static_cast<Code::Kind>(GetCodeKind()),
185 UNINITIALIZED); 187 UNINITIALIZED);
186 Handle<Object> probe( 188 Handle<Object> probe(
187 known_map_->FindInCodeCache(*factory->compare_ic_symbol(), flags)); 189 known_map_->FindInCodeCache(
190 strict() ?
191 *factory->strict_compare_ic_symbol() :
192 *factory->compare_ic_symbol(),
193 flags));
188 if (probe->IsCode()) { 194 if (probe->IsCode()) {
189 *code_out = Code::cast(*probe); 195 *code_out = Code::cast(*probe);
Vyacheslav Egorov (Google) 2012/08/15 14:24:30 I wonder if we can fetch some information from the
190 return true; 196 return true;
191 } 197 }
192 return false; 198 return false;
193 } 199 }
194 200
195 201
196 int ICCompareStub::MinorKey() { 202 int ICCompareStub::MinorKey() {
197 return OpField::encode(op_ - Token::EQ) | StateField::encode(state_); 203 return OpField::encode(op_ - Token::EQ) | StateField::encode(state_);
198 } 204 }
199 205
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // already active, as the hooks won't stack. 492 // already active, as the hooks won't stack.
487 if (entry_hook != 0 && entry_hook_ != 0) 493 if (entry_hook != 0 && entry_hook_ != 0)
488 return false; 494 return false;
489 495
490 entry_hook_ = entry_hook; 496 entry_hook_ = entry_hook;
491 return true; 497 return true;
492 } 498 }
493 499
494 500
495 } } // namespace v8::internal 501 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698