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

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

Issue 2051823002: Reland of [ic] Don't pollute per-map code cache with CompareIC stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 UNREACHABLE(); 366 UNREACHABLE();
367 return ::v8::internal::UNINITIALIZED; 367 return ::v8::internal::UNINITIALIZED;
368 } 368 }
369 369
370 370
371 Condition CompareICStub::GetCondition() const { 371 Condition CompareICStub::GetCondition() const {
372 return CompareIC::ComputeCondition(op()); 372 return CompareIC::ComputeCondition(op());
373 } 373 }
374 374
375 375
376 void CompareICStub::AddToSpecialCache(Handle<Code> new_object) {
377 DCHECK(*known_map_ != NULL);
378 Isolate* isolate = new_object->GetIsolate();
379 Factory* factory = isolate->factory();
380 return Map::UpdateCodeCache(known_map_,
381 strict() ?
382 factory->strict_compare_ic_string() :
383 factory->compare_ic_string(),
384 new_object);
385 }
386
387
388 bool CompareICStub::FindCodeInSpecialCache(Code** code_out) {
389 Code::Flags flags = Code::ComputeFlags(
390 GetCodeKind(),
391 UNINITIALIZED);
392 Name* name = strict() ? isolate()->heap()->strict_compare_ic_string()
393 : isolate()->heap()->compare_ic_string();
394 Code* code = known_map_->LookupInCodeCache(name, flags);
395 if (code != nullptr) {
396 *code_out = code;
397 #ifdef DEBUG
398 CompareICStub decode((*code_out)->stub_key(), isolate());
399 DCHECK(op() == decode.op());
400 DCHECK(left() == decode.left());
401 DCHECK(right() == decode.right());
402 DCHECK(state() == decode.state());
403 #endif
404 return true;
405 }
406 return false;
407 }
408
409
410 void CompareICStub::Generate(MacroAssembler* masm) { 376 void CompareICStub::Generate(MacroAssembler* masm) {
411 switch (state()) { 377 switch (state()) {
412 case CompareICState::UNINITIALIZED: 378 case CompareICState::UNINITIALIZED:
413 GenerateMiss(masm); 379 GenerateMiss(masm);
414 break; 380 break;
415 case CompareICState::BOOLEAN: 381 case CompareICState::BOOLEAN:
416 GenerateBooleans(masm); 382 GenerateBooleans(masm);
417 break; 383 break;
418 case CompareICState::SMI: 384 case CompareICState::SMI:
419 GenerateSmis(masm); 385 GenerateSmis(masm);
(...skipping 4358 matching lines...) Expand 10 before | Expand all | Expand 10 after
4778 if (type->Is(Type::UntaggedPointer())) { 4744 if (type->Is(Type::UntaggedPointer())) {
4779 return Representation::External(); 4745 return Representation::External();
4780 } 4746 }
4781 4747
4782 DCHECK(!type->Is(Type::Untagged())); 4748 DCHECK(!type->Is(Type::Untagged()));
4783 return Representation::Tagged(); 4749 return Representation::Tagged();
4784 } 4750 }
4785 4751
4786 } // namespace internal 4752 } // namespace internal
4787 } // namespace v8 4753 } // namespace v8
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