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

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

Issue 8305001: Introduce HTransitionElementsKind instruction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: nits fixed Created 9 years, 2 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/x64/ic-x64.cc ('k') | src/x64/lithium-x64.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 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 3205 matching lines...) Expand 10 before | Expand all | Expand 10 after
3216 ASSERT(ToRegister(instr->key()).is(rcx)); 3216 ASSERT(ToRegister(instr->key()).is(rcx));
3217 ASSERT(ToRegister(instr->value()).is(rax)); 3217 ASSERT(ToRegister(instr->value()).is(rax));
3218 3218
3219 Handle<Code> ic = instr->strict_mode() 3219 Handle<Code> ic = instr->strict_mode()
3220 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() 3220 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
3221 : isolate()->builtins()->KeyedStoreIC_Initialize(); 3221 : isolate()->builtins()->KeyedStoreIC_Initialize();
3222 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3222 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3223 } 3223 }
3224 3224
3225 3225
3226 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
3227 Register object_reg = ToRegister(instr->object());
3228 Register new_map_reg = ToRegister(instr->new_map_reg());
3229
3230 Handle<Map> from_map = instr->original_map();
3231 Handle<Map> to_map = instr->transitioned_map();
3232 ElementsKind from_kind = from_map->elements_kind();
3233 ElementsKind to_kind = to_map->elements_kind();
3234
3235 Label not_applicable;
3236 __ Cmp(FieldOperand(object_reg, HeapObject::kMapOffset), from_map);
3237 __ j(not_equal, &not_applicable);
3238 __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT);
3239 if (from_kind == FAST_SMI_ONLY_ELEMENTS && to_kind == FAST_ELEMENTS) {
3240 __ movq(FieldOperand(object_reg, HeapObject::kMapOffset), new_map_reg);
3241 // Write barrier.
3242 ASSERT_NE(instr->temp_reg(), NULL);
3243 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg,
3244 ToRegister(instr->temp_reg()), kDontSaveFPRegs);
3245 } else if (from_kind == FAST_SMI_ONLY_ELEMENTS &&
3246 to_kind == FAST_DOUBLE_ELEMENTS) {
3247 Register fixed_object_reg = ToRegister(instr->temp_reg());
3248 ASSERT(fixed_object_reg.is(rdx));
3249 ASSERT(new_map_reg.is(rbx));
3250 __ movq(fixed_object_reg, object_reg);
3251 CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(),
3252 RelocInfo::CODE_TARGET, instr);
3253 } else if (from_kind == FAST_DOUBLE_ELEMENTS && to_kind == FAST_ELEMENTS) {
3254 Register fixed_object_reg = ToRegister(instr->temp_reg());
3255 ASSERT(fixed_object_reg.is(rdx));
3256 ASSERT(new_map_reg.is(rbx));
3257 __ movq(fixed_object_reg, object_reg);
3258 CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(),
3259 RelocInfo::CODE_TARGET, instr);
3260 } else {
3261 UNREACHABLE();
3262 }
3263 __ bind(&not_applicable);
3264 }
3265
3266
3226 void LCodeGen::DoStringAdd(LStringAdd* instr) { 3267 void LCodeGen::DoStringAdd(LStringAdd* instr) {
3227 EmitPushTaggedOperand(instr->left()); 3268 EmitPushTaggedOperand(instr->left());
3228 EmitPushTaggedOperand(instr->right()); 3269 EmitPushTaggedOperand(instr->right());
3229 StringAddStub stub(NO_STRING_CHECK_IN_STUB); 3270 StringAddStub stub(NO_STRING_CHECK_IN_STUB);
3230 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 3271 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3231 } 3272 }
3232 3273
3233 3274
3234 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { 3275 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
3235 class DeferredStringCharCodeAt: public LDeferredCode { 3276 class DeferredStringCharCodeAt: public LDeferredCode {
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
4196 RegisterEnvironmentForDeoptimization(environment); 4237 RegisterEnvironmentForDeoptimization(environment);
4197 ASSERT(osr_pc_offset_ == -1); 4238 ASSERT(osr_pc_offset_ == -1);
4198 osr_pc_offset_ = masm()->pc_offset(); 4239 osr_pc_offset_ = masm()->pc_offset();
4199 } 4240 }
4200 4241
4201 #undef __ 4242 #undef __
4202 4243
4203 } } // namespace v8::internal 4244 } } // namespace v8::internal
4204 4245
4205 #endif // V8_TARGET_ARCH_X64 4246 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/ic-x64.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698