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

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

Issue 9015020: Make sure transitioned arrays efficiently call builtin Array functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: merge with latest Created 8 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/arm/macro-assembler-arm.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 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 4136 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 __ mov(ip, Operand(Handle<Object>(cell))); 4148 __ mov(ip, Operand(Handle<Object>(cell)));
4149 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); 4149 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset));
4150 __ cmp(reg, ip); 4150 __ cmp(reg, ip);
4151 } else { 4151 } else {
4152 __ cmp(reg, Operand(target)); 4152 __ cmp(reg, Operand(target));
4153 } 4153 }
4154 DeoptimizeIf(ne, instr->environment()); 4154 DeoptimizeIf(ne, instr->environment());
4155 } 4155 }
4156 4156
4157 4157
4158 void LCodeGen::DoCheckMapCommon(Register reg,
4159 Register scratch,
4160 Handle<Map> map,
4161 CompareMapMode mode,
4162 LEnvironment* env) {
4163 Label success;
4164 __ CompareMap(reg, scratch, map, &success, mode);
4165 DeoptimizeIf(ne, env);
4166 __ bind(&success);
4167 }
4168
4169
4158 void LCodeGen::DoCheckMap(LCheckMap* instr) { 4170 void LCodeGen::DoCheckMap(LCheckMap* instr) {
4159 Register scratch = scratch0(); 4171 Register scratch = scratch0();
4160 LOperand* input = instr->InputAt(0); 4172 LOperand* input = instr->InputAt(0);
4161 ASSERT(input->IsRegister()); 4173 ASSERT(input->IsRegister());
4162 Register reg = ToRegister(input); 4174 Register reg = ToRegister(input);
4163 __ ldr(scratch, FieldMemOperand(reg, HeapObject::kMapOffset)); 4175 Handle<Map> map = instr->hydrogen()->map();
4164 __ cmp(scratch, Operand(instr->hydrogen()->map())); 4176 DoCheckMapCommon(reg, scratch, map, instr->hydrogen()->mode(),
4165 DeoptimizeIf(ne, instr->environment()); 4177 instr->environment());
4166 } 4178 }
4167 4179
4168 4180
4169 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { 4181 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) {
4170 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); 4182 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped());
4171 Register result_reg = ToRegister(instr->result()); 4183 Register result_reg = ToRegister(instr->result());
4172 DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0)); 4184 DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0));
4173 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); 4185 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg);
4174 } 4186 }
4175 4187
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
4224 Register temp2 = ToRegister(instr->TempAt(1)); 4236 Register temp2 = ToRegister(instr->TempAt(1));
4225 4237
4226 Handle<JSObject> holder = instr->holder(); 4238 Handle<JSObject> holder = instr->holder();
4227 Handle<JSObject> current_prototype = instr->prototype(); 4239 Handle<JSObject> current_prototype = instr->prototype();
4228 4240
4229 // Load prototype object. 4241 // Load prototype object.
4230 __ LoadHeapObject(temp1, current_prototype); 4242 __ LoadHeapObject(temp1, current_prototype);
4231 4243
4232 // Check prototype maps up to the holder. 4244 // Check prototype maps up to the holder.
4233 while (!current_prototype.is_identical_to(holder)) { 4245 while (!current_prototype.is_identical_to(holder)) {
4234 __ ldr(temp2, FieldMemOperand(temp1, HeapObject::kMapOffset)); 4246 DoCheckMapCommon(temp1, temp2,
4235 __ cmp(temp2, Operand(Handle<Map>(current_prototype->map()))); 4247 Handle<Map>(current_prototype->map()),
4236 DeoptimizeIf(ne, instr->environment()); 4248 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
4237 current_prototype = 4249 current_prototype =
4238 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); 4250 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype()));
4239 // Load next prototype object. 4251 // Load next prototype object.
4240 __ LoadHeapObject(temp1, current_prototype); 4252 __ LoadHeapObject(temp1, current_prototype);
4241 } 4253 }
4242 4254
4243 // Check the holder map. 4255 // Check the holder map.
4244 __ ldr(temp2, FieldMemOperand(temp1, HeapObject::kMapOffset)); 4256 DoCheckMapCommon(temp1, temp2,
4245 __ cmp(temp2, Operand(Handle<Map>(current_prototype->map()))); 4257 Handle<Map>(current_prototype->map()),
4258 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
4246 DeoptimizeIf(ne, instr->environment()); 4259 DeoptimizeIf(ne, instr->environment());
4247 } 4260 }
4248 4261
4249 4262
4250 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { 4263 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
4251 Heap* heap = isolate()->heap(); 4264 Heap* heap = isolate()->heap();
4252 ElementsKind boilerplate_elements_kind = 4265 ElementsKind boilerplate_elements_kind =
4253 instr->hydrogen()->boilerplate_elements_kind(); 4266 instr->hydrogen()->boilerplate_elements_kind();
4254 4267
4255 // Deopt if the array literal boilerplate ElementsKind is of a type different 4268 // Deopt if the array literal boilerplate ElementsKind is of a type different
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
4732 ASSERT(osr_pc_offset_ == -1); 4745 ASSERT(osr_pc_offset_ == -1);
4733 osr_pc_offset_ = masm()->pc_offset(); 4746 osr_pc_offset_ = masm()->pc_offset();
4734 } 4747 }
4735 4748
4736 4749
4737 4750
4738 4751
4739 #undef __ 4752 #undef __
4740 4753
4741 } } // namespace v8::internal 4754 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698