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

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

Issue 16613003: fix InlineCacheState for ToBoolean and CompareIC (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/code-stubs.h ('k') | no next file » | 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 GenerateBothStringStub(masm); 298 GenerateBothStringStub(masm);
299 return; 299 return;
300 } 300 }
301 // Try to add arguments as strings, otherwise, transition to the generic 301 // Try to add arguments as strings, otherwise, transition to the generic
302 // BinaryOpIC type. 302 // BinaryOpIC type.
303 GenerateAddStrings(masm); 303 GenerateAddStrings(masm);
304 GenerateTypeTransition(masm); 304 GenerateTypeTransition(masm);
305 } 305 }
306 306
307 307
308 InlineCacheState ICCompareStub::GetICState() {
309 CompareIC::State state = Max(left_, right_);
310 switch (state) {
311 case CompareIC::UNINITIALIZED:
312 return ::v8::internal::UNINITIALIZED;
313 case CompareIC::SMI:
314 case CompareIC::NUMBER:
315 case CompareIC::INTERNALIZED_STRING:
316 case CompareIC::STRING:
317 case CompareIC::UNIQUE_NAME:
318 case CompareIC::OBJECT:
319 case CompareIC::KNOWN_OBJECT:
320 return MONOMORPHIC;
321 case CompareIC::GENERIC:
322 return ::v8::internal::GENERIC;
323 }
324 UNREACHABLE();
325 return ::v8::internal::UNINITIALIZED;
326 }
327
328
308 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) { 329 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) {
309 ASSERT(*known_map_ != NULL); 330 ASSERT(*known_map_ != NULL);
310 Isolate* isolate = new_object->GetIsolate(); 331 Isolate* isolate = new_object->GetIsolate();
311 Factory* factory = isolate->factory(); 332 Factory* factory = isolate->factory();
312 return Map::UpdateCodeCache(known_map_, 333 return Map::UpdateCodeCache(known_map_,
313 strict() ? 334 strict() ?
314 factory->strict_compare_ic_string() : 335 factory->strict_compare_ic_string() :
315 factory->compare_ic_string(), 336 factory->compare_ic_string(),
316 new_object); 337 new_object);
317 } 338 }
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 InstallDescriptor(isolate, &stub3); 807 InstallDescriptor(isolate, &stub3);
787 } 808 }
788 809
789 InternalArrayConstructorStub::InternalArrayConstructorStub( 810 InternalArrayConstructorStub::InternalArrayConstructorStub(
790 Isolate* isolate) { 811 Isolate* isolate) {
791 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 812 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
792 } 813 }
793 814
794 815
795 } } // namespace v8::internal 816 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698