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

Side by Side Diff: src/x64/lithium-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/lithium-x64.h ('k') | test/mjsunit/elements-kind.js » ('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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { 441 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
442 object()->PrintTo(stream); 442 object()->PrintTo(stream);
443 stream->Add("["); 443 stream->Add("[");
444 key()->PrintTo(stream); 444 key()->PrintTo(stream);
445 stream->Add("] <- "); 445 stream->Add("] <- ");
446 value()->PrintTo(stream); 446 value()->PrintTo(stream);
447 } 447 }
448 448
449 449
450 void LTransitionElementsKind::PrintDataTo(StringStream* stream) {
451 object()->PrintTo(stream);
452 stream->Add(" %p -> %p", *original_map(), *transitioned_map());
453 }
454
455
450 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) { 456 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) {
451 LInstructionGap* gap = new LInstructionGap(block); 457 LInstructionGap* gap = new LInstructionGap(block);
452 int index = -1; 458 int index = -1;
453 if (instr->IsControl()) { 459 if (instr->IsControl()) {
454 instructions_.Add(gap); 460 instructions_.Add(gap);
455 index = instructions_.length(); 461 index = instructions_.length();
456 instructions_.Add(instr); 462 instructions_.Add(instr);
457 } else { 463 } else {
458 index = instructions_.length(); 464 index = instructions_.length();
459 instructions_.Add(instr); 465 instructions_.Add(instr);
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 1955
1950 ASSERT(instr->object()->representation().IsTagged()); 1956 ASSERT(instr->object()->representation().IsTagged());
1951 ASSERT(instr->key()->representation().IsTagged()); 1957 ASSERT(instr->key()->representation().IsTagged());
1952 ASSERT(instr->value()->representation().IsTagged()); 1958 ASSERT(instr->value()->representation().IsTagged());
1953 1959
1954 LStoreKeyedGeneric* result = new LStoreKeyedGeneric(object, key, value); 1960 LStoreKeyedGeneric* result = new LStoreKeyedGeneric(object, key, value);
1955 return MarkAsCall(result, instr); 1961 return MarkAsCall(result, instr);
1956 } 1962 }
1957 1963
1958 1964
1965 LInstruction* LChunkBuilder::DoTransitionElementsKind(
1966 HTransitionElementsKind* instr) {
1967 if (instr->original_map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS &&
1968 instr->transitioned_map()->elements_kind() == FAST_ELEMENTS) {
1969 LOperand* object = UseRegister(instr->object());
1970 LOperand* new_map_reg = TempRegister();
1971 LOperand* temp_reg = TempRegister();
1972 LTransitionElementsKind* result =
1973 new LTransitionElementsKind(object, new_map_reg, temp_reg);
1974 return DefineSameAsFirst(result);
1975 } else {
1976 LOperand* object = UseFixed(instr->object(), rax);
1977 LOperand* fixed_object_reg = FixedTemp(rdx);
1978 LOperand* new_map_reg = FixedTemp(rbx);
1979 LTransitionElementsKind* result =
1980 new LTransitionElementsKind(object, new_map_reg, fixed_object_reg);
1981 return MarkAsCall(DefineFixed(result, rax), instr);
1982 }
1983 }
1984
1985
1959 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { 1986 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
1960 bool needs_write_barrier = instr->NeedsWriteBarrier(); 1987 bool needs_write_barrier = instr->NeedsWriteBarrier();
1961 1988
1962 LOperand* obj = needs_write_barrier 1989 LOperand* obj = needs_write_barrier
1963 ? UseTempRegister(instr->object()) 1990 ? UseTempRegister(instr->object())
1964 : UseRegisterAtStart(instr->object()); 1991 : UseRegisterAtStart(instr->object());
1965 1992
1966 LOperand* val = needs_write_barrier 1993 LOperand* val = needs_write_barrier
1967 ? UseTempRegister(instr->value()) 1994 ? UseTempRegister(instr->value())
1968 : UseRegister(instr->value()); 1995 : UseRegister(instr->value());
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 LOperand* key = UseOrConstantAtStart(instr->key()); 2204 LOperand* key = UseOrConstantAtStart(instr->key());
2178 LOperand* object = UseOrConstantAtStart(instr->object()); 2205 LOperand* object = UseOrConstantAtStart(instr->object());
2179 LIn* result = new LIn(key, object); 2206 LIn* result = new LIn(key, object);
2180 return MarkAsCall(DefineFixed(result, rax), instr); 2207 return MarkAsCall(DefineFixed(result, rax), instr);
2181 } 2208 }
2182 2209
2183 2210
2184 } } // namespace v8::internal 2211 } } // namespace v8::internal
2185 2212
2186 #endif // V8_TARGET_ARCH_X64 2213 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/elements-kind.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698