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

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

Issue 10857055: Fix bug in compare IC. BUG=2291 (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.11/
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();
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);
188 ASSERT(op_ == Token::EQ || op_ == Token::EQ_STRICT);
186 Handle<Object> probe( 189 Handle<Object> probe(
187 known_map_->FindInCodeCache(*factory->compare_ic_symbol(), flags)); 190 known_map_->FindInCodeCache(
191 strict() ?
192 *factory->strict_compare_ic_symbol() :
193 *factory->compare_ic_symbol(),
194 flags));
188 if (probe->IsCode()) { 195 if (probe->IsCode()) {
189 *code_out = Code::cast(*probe); 196 *code_out = Code::cast(*probe);
197 ASSERT(op_ == (*code_out)->compare_operation());
190 return true; 198 return true;
191 } 199 }
192 return false; 200 return false;
193 } 201 }
194 202
195 203
196 int ICCompareStub::MinorKey() { 204 int ICCompareStub::MinorKey() {
197 return OpField::encode(op_ - Token::EQ) | StateField::encode(state_); 205 return OpField::encode(op_ - Token::EQ) | StateField::encode(state_);
198 } 206 }
199 207
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 GenerateMapChangeElementsTransition(masm); 472 GenerateMapChangeElementsTransition(masm);
465 } else { 473 } else {
466 UNREACHABLE(); 474 UNREACHABLE();
467 } 475 }
468 } 476 }
469 masm->bind(&fail); 477 masm->bind(&fail);
470 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_); 478 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_);
471 } 479 }
472 480
473 } } // namespace v8::internal 481 } } // 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