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

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

Issue 328553005: Sign extend the dehoisted key at the definition point for x64 port only; for x32 port, we need to si (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/lithium-allocator-inl.h" 9 #include "src/lithium-allocator-inl.h"
10 #include "src/x64/lithium-x64.h" 10 #include "src/x64/lithium-x64.h"
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); 2103 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function()))));
2104 } 2104 }
2105 2105
2106 2106
2107 LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { 2107 LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) {
2108 return DefineAsRegister(new(zone()) LLoadRoot); 2108 return DefineAsRegister(new(zone()) LLoadRoot);
2109 } 2109 }
2110 2110
2111 2111
2112 void LChunkBuilder::FindDehoistedKeyDefinitions(HValue* candidate) { 2112 void LChunkBuilder::FindDehoistedKeyDefinitions(HValue* candidate) {
2113 ASSERT(kPointerSize == kInt64Size);
2113 BitVector* dehoisted_key_ids = chunk_->GetDehoistedKeyIds(); 2114 BitVector* dehoisted_key_ids = chunk_->GetDehoistedKeyIds();
2114 if (dehoisted_key_ids->Contains(candidate->id())) return; 2115 if (dehoisted_key_ids->Contains(candidate->id())) return;
2115 dehoisted_key_ids->Add(candidate->id()); 2116 dehoisted_key_ids->Add(candidate->id());
2116 if (!candidate->IsPhi()) return; 2117 if (!candidate->IsPhi()) return;
2117 for (int i = 0; i < candidate->OperandCount(); ++i) { 2118 for (int i = 0; i < candidate->OperandCount(); ++i) {
2118 FindDehoistedKeyDefinitions(candidate->OperandAt(i)); 2119 FindDehoistedKeyDefinitions(candidate->OperandAt(i));
2119 } 2120 }
2120 } 2121 }
2121 2122
2122 2123
2123 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { 2124 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
2124 ASSERT(instr->key()->representation().IsInteger32()); 2125 ASSERT(instr->key()->representation().IsInteger32());
2125 ElementsKind elements_kind = instr->elements_kind(); 2126 ElementsKind elements_kind = instr->elements_kind();
2126 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2127 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
2127 LInstruction* result = NULL; 2128 LInstruction* result = NULL;
2128 2129
2129 if (instr->IsDehoisted()) { 2130 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) {
2130 FindDehoistedKeyDefinitions(instr->key()); 2131 FindDehoistedKeyDefinitions(instr->key());
2131 } 2132 }
2132 2133
2133 if (!instr->is_typed_elements()) { 2134 if (!instr->is_typed_elements()) {
2134 LOperand* obj = UseRegisterAtStart(instr->elements()); 2135 LOperand* obj = UseRegisterAtStart(instr->elements());
2135 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); 2136 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key));
2136 } else { 2137 } else {
2137 ASSERT( 2138 ASSERT(
2138 (instr->representation().IsInteger32() && 2139 (instr->representation().IsInteger32() &&
2139 !(IsDoubleOrFloatElementsKind(elements_kind))) || 2140 !(IsDoubleOrFloatElementsKind(elements_kind))) ||
(...skipping 24 matching lines...) Expand all
2164 2165
2165 LLoadKeyedGeneric* result = 2166 LLoadKeyedGeneric* result =
2166 new(zone()) LLoadKeyedGeneric(context, object, key); 2167 new(zone()) LLoadKeyedGeneric(context, object, key);
2167 return MarkAsCall(DefineFixed(result, rax), instr); 2168 return MarkAsCall(DefineFixed(result, rax), instr);
2168 } 2169 }
2169 2170
2170 2171
2171 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2172 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2172 ElementsKind elements_kind = instr->elements_kind(); 2173 ElementsKind elements_kind = instr->elements_kind();
2173 2174
2174 if (instr->IsDehoisted()) { 2175 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) {
2175 FindDehoistedKeyDefinitions(instr->key()); 2176 FindDehoistedKeyDefinitions(instr->key());
2176 } 2177 }
2177 2178
2178 if (!instr->is_typed_elements()) { 2179 if (!instr->is_typed_elements()) {
2179 ASSERT(instr->elements()->representation().IsTagged()); 2180 ASSERT(instr->elements()->representation().IsTagged());
2180 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2181 bool needs_write_barrier = instr->NeedsWriteBarrier();
2181 LOperand* object = NULL; 2182 LOperand* object = NULL;
2182 LOperand* key = NULL; 2183 LOperand* key = NULL;
2183 LOperand* val = NULL; 2184 LOperand* val = NULL;
2184 2185
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
2597 LOperand* function = UseRegisterAtStart(instr->function()); 2598 LOperand* function = UseRegisterAtStart(instr->function());
2598 LAllocateBlockContext* result = 2599 LAllocateBlockContext* result =
2599 new(zone()) LAllocateBlockContext(context, function); 2600 new(zone()) LAllocateBlockContext(context, function);
2600 return MarkAsCall(DefineFixed(result, rsi), instr); 2601 return MarkAsCall(DefineFixed(result, rsi), instr);
2601 } 2602 }
2602 2603
2603 2604
2604 } } // namespace v8::internal 2605 } } // namespace v8::internal
2605 2606
2606 #endif // V8_TARGET_ARCH_X64 2607 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/x64/lithium-codegen-x64.cc ('K') | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698