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

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

Issue 6094020: Simplify CheckPrototypeMaps. (Closed)
Patch Set: Update ARM lithium Created 9 years, 11 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3148 } else { 3148 } else {
3149 __ mov(result, prototype); 3149 __ mov(result, prototype);
3150 } 3150 }
3151 } 3151 }
3152 3152
3153 3153
3154 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { 3154 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
3155 Register reg = ToRegister(instr->temp()); 3155 Register reg = ToRegister(instr->temp());
3156 3156
3157 Handle<JSObject> holder = instr->holder(); 3157 Handle<JSObject> holder = instr->holder();
3158 Handle<Map> receiver_map = instr->receiver_map(); 3158 Handle<JSObject> current_prototype = instr->prototype();
3159 Handle<JSObject> current_prototype(JSObject::cast(receiver_map->prototype()));
3160 3159
3161 // Load prototype object. 3160 // Load prototype object.
3162 LoadPrototype(reg, current_prototype); 3161 LoadPrototype(reg, current_prototype);
3163 3162
3164 // Check prototype maps up to the holder. 3163 // Check prototype maps up to the holder.
3165 while (!current_prototype.is_identical_to(holder)) { 3164 while (!current_prototype.is_identical_to(holder)) {
3166 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), 3165 __ cmp(FieldOperand(reg, HeapObject::kMapOffset),
3167 Handle<Map>(current_prototype->map())); 3166 Handle<Map>(current_prototype->map()));
3168 DeoptimizeIf(not_equal, instr->environment()); 3167 DeoptimizeIf(not_equal, instr->environment());
3169 current_prototype = 3168 current_prototype =
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
3476 ASSERT(!environment->HasBeenRegistered()); 3475 ASSERT(!environment->HasBeenRegistered());
3477 RegisterEnvironmentForDeoptimization(environment); 3476 RegisterEnvironmentForDeoptimization(environment);
3478 ASSERT(osr_pc_offset_ == -1); 3477 ASSERT(osr_pc_offset_ == -1);
3479 osr_pc_offset_ = masm()->pc_offset(); 3478 osr_pc_offset_ = masm()->pc_offset();
3480 } 3479 }
3481 3480
3482 3481
3483 #undef __ 3482 #undef __
3484 3483
3485 } } // namespace v8::internal 3484 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698