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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 19954005: Eliminate map checks of constant values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Naming Created 7 years, 5 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/objects-inl.h ('k') | src/x64/lithium-x64.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 4936 matching lines...) Expand 10 before | Expand all | Expand 10 after
4947 Handle<Map> map, 4947 Handle<Map> map,
4948 LInstruction* instr) { 4948 LInstruction* instr) {
4949 Label success; 4949 Label success;
4950 __ CompareMap(reg, map, &success); 4950 __ CompareMap(reg, map, &success);
4951 DeoptimizeIf(not_equal, instr->environment()); 4951 DeoptimizeIf(not_equal, instr->environment());
4952 __ bind(&success); 4952 __ bind(&success);
4953 } 4953 }
4954 4954
4955 4955
4956 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { 4956 void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
4957 if (instr->hydrogen()->CanOmitMapChecks()) return;
4957 LOperand* input = instr->value(); 4958 LOperand* input = instr->value();
4958 ASSERT(input->IsRegister()); 4959 ASSERT(input->IsRegister());
4959 Register reg = ToRegister(input); 4960 Register reg = ToRegister(input);
4960 4961
4961 Label success; 4962 Label success;
4962 SmallMapList* map_set = instr->hydrogen()->map_set(); 4963 SmallMapList* map_set = instr->hydrogen()->map_set();
4963 for (int i = 0; i < map_set->length() - 1; i++) { 4964 for (int i = 0; i < map_set->length() - 1; i++) {
4964 Handle<Map> map = map_set->at(i); 4965 Handle<Map> map = map_set->at(i);
4965 __ CompareMap(reg, map, &success); 4966 __ CompareMap(reg, map, &success);
4966 __ j(equal, &success); 4967 __ j(equal, &success);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
5014 // smi 5015 // smi
5015 __ bind(&is_smi); 5016 __ bind(&is_smi);
5016 __ SmiToInteger32(input_reg, input_reg); 5017 __ SmiToInteger32(input_reg, input_reg);
5017 __ ClampUint8(input_reg); 5018 __ ClampUint8(input_reg);
5018 5019
5019 __ bind(&done); 5020 __ bind(&done);
5020 } 5021 }
5021 5022
5022 5023
5023 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { 5024 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
5025 if (instr->hydrogen()->CanOmitPrototypeChecks()) return;
5024 Register reg = ToRegister(instr->temp()); 5026 Register reg = ToRegister(instr->temp());
5025 5027
5026 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); 5028 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes();
5027 ZoneList<Handle<Map> >* maps = instr->maps(); 5029 ZoneList<Handle<Map> >* maps = instr->maps();
5028 5030
5029 ASSERT(prototypes->length() == maps->length()); 5031 ASSERT(prototypes->length() == maps->length());
5030 5032
5031 if (!instr->hydrogen()->CanOmitPrototypeChecks()) { 5033 for (int i = 0; i < prototypes->length(); i++) {
5032 for (int i = 0; i < prototypes->length(); i++) { 5034 __ LoadHeapObject(reg, prototypes->at(i));
5033 __ LoadHeapObject(reg, prototypes->at(i)); 5035 DoCheckMapCommon(reg, maps->at(i), instr);
5034 DoCheckMapCommon(reg, maps->at(i), instr);
5035 }
5036 } 5036 }
5037 } 5037 }
5038 5038
5039 5039
5040 void LCodeGen::DoAllocate(LAllocate* instr) { 5040 void LCodeGen::DoAllocate(LAllocate* instr) {
5041 class DeferredAllocate: public LDeferredCode { 5041 class DeferredAllocate: public LDeferredCode {
5042 public: 5042 public:
5043 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) 5043 DeferredAllocate(LCodeGen* codegen, LAllocate* instr)
5044 : LDeferredCode(codegen), instr_(instr) { } 5044 : LDeferredCode(codegen), instr_(instr) { }
5045 virtual void Generate() { codegen()->DoDeferredAllocate(instr_); } 5045 virtual void Generate() { codegen()->DoDeferredAllocate(instr_); }
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
5538 FixedArray::kHeaderSize - kPointerSize)); 5538 FixedArray::kHeaderSize - kPointerSize));
5539 __ bind(&done); 5539 __ bind(&done);
5540 } 5540 }
5541 5541
5542 5542
5543 #undef __ 5543 #undef __
5544 5544
5545 } } // namespace v8::internal 5545 } } // namespace v8::internal
5546 5546
5547 #endif // V8_TARGET_ARCH_X64 5547 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698