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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/ia32/ic-ia32.cc ('k') | src/ia32/lithium-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 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 3285 matching lines...) Expand 10 before | Expand all | Expand 10 after
3296 ASSERT(ToRegister(instr->key()).is(ecx)); 3296 ASSERT(ToRegister(instr->key()).is(ecx));
3297 ASSERT(ToRegister(instr->value()).is(eax)); 3297 ASSERT(ToRegister(instr->value()).is(eax));
3298 3298
3299 Handle<Code> ic = instr->strict_mode() 3299 Handle<Code> ic = instr->strict_mode()
3300 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() 3300 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
3301 : isolate()->builtins()->KeyedStoreIC_Initialize(); 3301 : isolate()->builtins()->KeyedStoreIC_Initialize();
3302 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3302 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3303 } 3303 }
3304 3304
3305 3305
3306 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
3307 Register object_reg = ToRegister(instr->object());
3308 Register new_map_reg = ToRegister(instr->new_map_reg());
3309
3310 Handle<Map> from_map = instr->original_map();
3311 Handle<Map> to_map = instr->transitioned_map();
3312 ElementsKind from_kind = from_map->elements_kind();
3313 ElementsKind to_kind = to_map->elements_kind();
3314
3315 Label not_applicable;
3316 __ cmp(FieldOperand(object_reg, HeapObject::kMapOffset), from_map);
3317 __ j(not_equal, &not_applicable);
3318 __ mov(new_map_reg, to_map);
3319 if (from_kind == FAST_SMI_ONLY_ELEMENTS && to_kind == FAST_ELEMENTS) {
3320 Register object_reg = ToRegister(instr->object());
3321 __ mov(FieldOperand(object_reg, HeapObject::kMapOffset), new_map_reg);
3322 // Write barrier.
3323 ASSERT_NE(instr->temp_reg(), NULL);
3324 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg,
3325 ToRegister(instr->temp_reg()), kDontSaveFPRegs);
3326 } else if (from_kind == FAST_SMI_ONLY_ELEMENTS &&
3327 to_kind == FAST_DOUBLE_ELEMENTS) {
3328 Register fixed_object_reg = ToRegister(instr->temp_reg());
3329 ASSERT(fixed_object_reg.is(edx));
3330 ASSERT(new_map_reg.is(ebx));
3331 __ mov(fixed_object_reg, object_reg);
3332 CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(),
3333 RelocInfo::CODE_TARGET, instr);
3334 } else if (from_kind == FAST_DOUBLE_ELEMENTS && to_kind == FAST_ELEMENTS) {
3335 Register fixed_object_reg = ToRegister(instr->temp_reg());
3336 ASSERT(fixed_object_reg.is(edx));
3337 ASSERT(new_map_reg.is(ebx));
3338 __ mov(fixed_object_reg, object_reg);
3339 CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(),
3340 RelocInfo::CODE_TARGET, instr);
3341 } else {
3342 UNREACHABLE();
3343 }
3344 __ bind(&not_applicable);
3345 }
3346
3347
3306 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { 3348 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
3307 class DeferredStringCharCodeAt: public LDeferredCode { 3349 class DeferredStringCharCodeAt: public LDeferredCode {
3308 public: 3350 public:
3309 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) 3351 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr)
3310 : LDeferredCode(codegen), instr_(instr) { } 3352 : LDeferredCode(codegen), instr_(instr) { }
3311 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } 3353 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); }
3312 virtual LInstruction* instr() { return instr_; } 3354 virtual LInstruction* instr() { return instr_; }
3313 private: 3355 private:
3314 LStringCharCodeAt* instr_; 3356 LStringCharCodeAt* instr_;
3315 }; 3357 };
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
4489 env->deoptimization_index()); 4531 env->deoptimization_index());
4490 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4532 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4491 } 4533 }
4492 4534
4493 4535
4494 #undef __ 4536 #undef __
4495 4537
4496 } } // namespace v8::internal 4538 } } // namespace v8::internal
4497 4539
4498 #endif // V8_TARGET_ARCH_IA32 4540 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/ic-ia32.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698