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

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

Issue 7631020: Version 3.5.6. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 9 years, 4 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-codegen-x64.h ('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 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2255 } 2255 }
2256 DeoptimizeIf(below_equal, instr->environment()); 2256 DeoptimizeIf(below_equal, instr->environment());
2257 2257
2258 // There are two words between the frame pointer and the last argument. 2258 // There are two words between the frame pointer and the last argument.
2259 // Subtracting from length accounts for one of them add one more. 2259 // Subtracting from length accounts for one of them add one more.
2260 __ movq(result, Operand(arguments, length, times_pointer_size, kPointerSize)); 2260 __ movq(result, Operand(arguments, length, times_pointer_size, kPointerSize));
2261 } 2261 }
2262 2262
2263 2263
2264 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { 2264 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
2265 Register elements = ToRegister(instr->elements());
2266 Register key = ToRegister(instr->key());
2267 Register result = ToRegister(instr->result()); 2265 Register result = ToRegister(instr->result());
2268 ASSERT(result.is(elements));
2269 2266
2270 // Load the result. 2267 // Load the result.
2271 __ movq(result, FieldOperand(elements, 2268 __ movq(result,
2272 key, 2269 BuildFastArrayOperand(instr->elements(), instr->key(),
2273 times_pointer_size, 2270 JSObject::FAST_ELEMENTS,
2274 FixedArray::kHeaderSize)); 2271 FixedArray::kHeaderSize - kHeapObjectTag));
2275 2272
2276 // Check for the hole value. 2273 // Check for the hole value.
2277 if (instr->hydrogen()->RequiresHoleCheck()) { 2274 if (instr->hydrogen()->RequiresHoleCheck()) {
2278 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 2275 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
2279 DeoptimizeIf(equal, instr->environment()); 2276 DeoptimizeIf(equal, instr->environment());
2280 } 2277 }
2281 } 2278 }
2282 2279
2283 2280
2284 void LCodeGen::DoLoadKeyedFastDoubleElement( 2281 void LCodeGen::DoLoadKeyedFastDoubleElement(
(...skipping 13 matching lines...) Expand all
2298 } 2295 }
2299 2296
2300 Operand double_load_operand = BuildFastArrayOperand( 2297 Operand double_load_operand = BuildFastArrayOperand(
2301 instr->elements(), instr->key(), JSObject::FAST_DOUBLE_ELEMENTS, 2298 instr->elements(), instr->key(), JSObject::FAST_DOUBLE_ELEMENTS,
2302 FixedDoubleArray::kHeaderSize - kHeapObjectTag); 2299 FixedDoubleArray::kHeaderSize - kHeapObjectTag);
2303 __ movsd(result, double_load_operand); 2300 __ movsd(result, double_load_operand);
2304 } 2301 }
2305 2302
2306 2303
2307 Operand LCodeGen::BuildFastArrayOperand( 2304 Operand LCodeGen::BuildFastArrayOperand(
2308 LOperand* external_pointer, 2305 LOperand* elements_pointer,
2309 LOperand* key, 2306 LOperand* key,
2310 JSObject::ElementsKind elements_kind, 2307 JSObject::ElementsKind elements_kind,
2311 uint32_t offset) { 2308 uint32_t offset) {
2312 Register external_pointer_reg = ToRegister(external_pointer); 2309 Register elements_pointer_reg = ToRegister(elements_pointer);
2313 int shift_size = ElementsKindToShiftSize(elements_kind); 2310 int shift_size = ElementsKindToShiftSize(elements_kind);
2314 if (key->IsConstantOperand()) { 2311 if (key->IsConstantOperand()) {
2315 int constant_value = ToInteger32(LConstantOperand::cast(key)); 2312 int constant_value = ToInteger32(LConstantOperand::cast(key));
2316 if (constant_value & 0xF0000000) { 2313 if (constant_value & 0xF0000000) {
2317 Abort("array index constant value too big"); 2314 Abort("array index constant value too big");
2318 } 2315 }
2319 return Operand(external_pointer_reg, 2316 return Operand(elements_pointer_reg,
2320 constant_value * (1 << shift_size) + offset); 2317 constant_value * (1 << shift_size) + offset);
2321 } else { 2318 } else {
2322 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); 2319 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size);
2323 return Operand(external_pointer_reg, ToRegister(key), 2320 return Operand(elements_pointer_reg, ToRegister(key),
2324 scale_factor, offset); 2321 scale_factor, offset);
2325 } 2322 }
2326 } 2323 }
2327 2324
2328 2325
2329 void LCodeGen::DoLoadKeyedSpecializedArrayElement( 2326 void LCodeGen::DoLoadKeyedSpecializedArrayElement(
2330 LLoadKeyedSpecializedArrayElement* instr) { 2327 LLoadKeyedSpecializedArrayElement* instr) {
2331 JSObject::ElementsKind elements_kind = instr->elements_kind(); 2328 JSObject::ElementsKind elements_kind = instr->elements_kind();
2332 Operand operand(BuildFastArrayOperand(instr->external_pointer(), 2329 Operand operand(BuildFastArrayOperand(instr->external_pointer(),
2333 instr->key(), elements_kind, 0)); 2330 instr->key(), elements_kind, 0));
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
3096 case JSObject::DICTIONARY_ELEMENTS: 3093 case JSObject::DICTIONARY_ELEMENTS:
3097 case JSObject::NON_STRICT_ARGUMENTS_ELEMENTS: 3094 case JSObject::NON_STRICT_ARGUMENTS_ELEMENTS:
3098 UNREACHABLE(); 3095 UNREACHABLE();
3099 break; 3096 break;
3100 } 3097 }
3101 } 3098 }
3102 } 3099 }
3103 3100
3104 3101
3105 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 3102 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
3106 if (instr->length()->IsRegister()) { 3103 if (instr->index()->IsConstantOperand()) {
3107 __ cmpq(ToRegister(instr->index()), ToRegister(instr->length())); 3104 if (instr->length()->IsRegister()) {
3105 __ cmpq(ToRegister(instr->length()),
3106 Immediate(ToInteger32(LConstantOperand::cast(instr->index()))));
3107 } else {
3108 __ cmpq(ToOperand(instr->length()),
3109 Immediate(ToInteger32(LConstantOperand::cast(instr->index()))));
3110 }
3108 } else { 3111 } else {
3109 __ cmpq(ToRegister(instr->index()), ToOperand(instr->length())); 3112 if (instr->length()->IsRegister()) {
3113 __ cmpq(ToRegister(instr->length()), ToRegister(instr->index()));
3114 } else {
3115 __ cmpq(ToOperand(instr->length()), ToRegister(instr->index()));
3116 }
3110 } 3117 }
3111 DeoptimizeIf(above_equal, instr->environment()); 3118 DeoptimizeIf(below_equal, instr->environment());
3112 } 3119 }
3113 3120
3114 3121
3115 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { 3122 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
3116 Register value = ToRegister(instr->value()); 3123 Register value = ToRegister(instr->value());
3117 Register elements = ToRegister(instr->object()); 3124 Register elements = ToRegister(instr->object());
3118 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; 3125 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg;
3119 3126
3120 // Do the store. 3127 // Do the store.
3121 if (instr->key()->IsConstantOperand()) { 3128 if (instr->key()->IsConstantOperand()) {
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
4156 RegisterEnvironmentForDeoptimization(environment); 4163 RegisterEnvironmentForDeoptimization(environment);
4157 ASSERT(osr_pc_offset_ == -1); 4164 ASSERT(osr_pc_offset_ == -1);
4158 osr_pc_offset_ = masm()->pc_offset(); 4165 osr_pc_offset_ = masm()->pc_offset();
4159 } 4166 }
4160 4167
4161 #undef __ 4168 #undef __
4162 4169
4163 } } // namespace v8::internal 4170 } } // namespace v8::internal
4164 4171
4165 #endif // V8_TARGET_ARCH_X64 4172 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698