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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/ia32/lithium-codegen-ia32.h ('k') | src/ia32/macro-assembler-ia32.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 4014 matching lines...) Expand 10 before | Expand all | Expand 10 after
4026 isolate()->factory()->NewJSGlobalPropertyCell(target); 4026 isolate()->factory()->NewJSGlobalPropertyCell(target);
4027 __ cmp(reg, Operand::Cell(cell)); 4027 __ cmp(reg, Operand::Cell(cell));
4028 } else { 4028 } else {
4029 Operand operand = ToOperand(instr->value()); 4029 Operand operand = ToOperand(instr->value());
4030 __ cmp(operand, target); 4030 __ cmp(operand, target);
4031 } 4031 }
4032 DeoptimizeIf(not_equal, instr->environment()); 4032 DeoptimizeIf(not_equal, instr->environment());
4033 } 4033 }
4034 4034
4035 4035
4036 void LCodeGen::DoCheckMapCommon(Register reg,
4037 Handle<Map> map,
4038 CompareMapMode mode,
4039 LEnvironment* env) {
4040 Label success;
4041 __ CompareMap(reg, map, &success, mode);
4042 DeoptimizeIf(not_equal, env);
4043 __ bind(&success);
4044 }
4045
4046
4036 void LCodeGen::DoCheckMap(LCheckMap* instr) { 4047 void LCodeGen::DoCheckMap(LCheckMap* instr) {
4037 LOperand* input = instr->InputAt(0); 4048 LOperand* input = instr->InputAt(0);
4038 ASSERT(input->IsRegister()); 4049 ASSERT(input->IsRegister());
4039 Register reg = ToRegister(input); 4050 Register reg = ToRegister(input);
4040 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), 4051 Handle<Map> map = instr->hydrogen()->map();
4041 instr->hydrogen()->map()); 4052 DoCheckMapCommon(reg, map, instr->hydrogen()->mode(), instr->environment());
4042 DeoptimizeIf(not_equal, instr->environment());
4043 } 4053 }
4044 4054
4045 4055
4046 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { 4056 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) {
4047 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); 4057 XMMRegister value_reg = ToDoubleRegister(instr->unclamped());
4048 Register result_reg = ToRegister(instr->result()); 4058 Register result_reg = ToRegister(instr->result());
4049 __ ClampDoubleToUint8(value_reg, xmm0, result_reg); 4059 __ ClampDoubleToUint8(value_reg, xmm0, result_reg);
4050 } 4060 }
4051 4061
4052 4062
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
4095 Register reg = ToRegister(instr->TempAt(0)); 4105 Register reg = ToRegister(instr->TempAt(0));
4096 4106
4097 Handle<JSObject> holder = instr->holder(); 4107 Handle<JSObject> holder = instr->holder();
4098 Handle<JSObject> current_prototype = instr->prototype(); 4108 Handle<JSObject> current_prototype = instr->prototype();
4099 4109
4100 // Load prototype object. 4110 // Load prototype object.
4101 __ LoadHeapObject(reg, current_prototype); 4111 __ LoadHeapObject(reg, current_prototype);
4102 4112
4103 // Check prototype maps up to the holder. 4113 // Check prototype maps up to the holder.
4104 while (!current_prototype.is_identical_to(holder)) { 4114 while (!current_prototype.is_identical_to(holder)) {
4105 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), 4115 DoCheckMapCommon(reg, Handle<Map>(current_prototype->map()),
4106 Handle<Map>(current_prototype->map())); 4116 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
4107 DeoptimizeIf(not_equal, instr->environment()); 4117
4108 current_prototype = 4118 current_prototype =
4109 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); 4119 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype()));
4110 // Load next prototype object. 4120 // Load next prototype object.
4111 __ LoadHeapObject(reg, current_prototype); 4121 __ LoadHeapObject(reg, current_prototype);
4112 } 4122 }
4113 4123
4114 // Check the holder map. 4124 // Check the holder map.
4115 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), 4125 DoCheckMapCommon(reg, Handle<Map>(current_prototype->map()),
4116 Handle<Map>(current_prototype->map())); 4126 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
4117 DeoptimizeIf(not_equal, instr->environment());
4118 } 4127 }
4119 4128
4120 4129
4121 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { 4130 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
4122 ASSERT(ToRegister(instr->context()).is(esi)); 4131 ASSERT(ToRegister(instr->context()).is(esi));
4123 Heap* heap = isolate()->heap(); 4132 Heap* heap = isolate()->heap();
4124 ElementsKind boilerplate_elements_kind = 4133 ElementsKind boilerplate_elements_kind =
4125 instr->hydrogen()->boilerplate_elements_kind(); 4134 instr->hydrogen()->boilerplate_elements_kind();
4126 4135
4127 // Deopt if the array literal boilerplate ElementsKind is of a type different 4136 // Deopt if the array literal boilerplate ElementsKind is of a type different
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
4612 this, pointers, Safepoint::kLazyDeopt); 4621 this, pointers, Safepoint::kLazyDeopt);
4613 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4622 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4614 } 4623 }
4615 4624
4616 4625
4617 #undef __ 4626 #undef __
4618 4627
4619 } } // namespace v8::internal 4628 } } // namespace v8::internal
4620 4629
4621 #endif // V8_TARGET_ARCH_IA32 4630 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698