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

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

Issue 6104004: Fix errors in x64 crankshaft port, add failing tests to test expectations. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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 | « no previous file | test/cctest/cctest.status » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 453
454 void FullCodeGenerator::StackValueContext::Plug(bool flag) const { 454 void FullCodeGenerator::StackValueContext::Plug(bool flag) const {
455 Heap::RootListIndex value_root_index = 455 Heap::RootListIndex value_root_index =
456 flag ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex; 456 flag ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex;
457 __ PushRoot(value_root_index); 457 __ PushRoot(value_root_index);
458 } 458 }
459 459
460 460
461 void FullCodeGenerator::TestContext::Plug(bool flag) const { 461 void FullCodeGenerator::TestContext::Plug(bool flag) const {
462 codegen()->PrepareForBailoutBeforeSplit(TOS_REG, true, NULL, NULL); 462 codegen()->PrepareForBailoutBeforeSplit(TOS_REG,
463 true,
464 true_label_,
465 false_label_);
463 if (flag) { 466 if (flag) {
464 if (true_label_ != fall_through_) __ jmp(true_label_); 467 if (true_label_ != fall_through_) __ jmp(true_label_);
465 } else { 468 } else {
466 if (false_label_ != fall_through_) __ jmp(false_label_); 469 if (false_label_ != fall_through_) __ jmp(false_label_);
467 } 470 }
468 } 471 }
469 472
470 473
471 void FullCodeGenerator::DoTest(Label* if_true, 474 void FullCodeGenerator::DoTest(Label* if_true,
472 Label* if_false, 475 Label* if_false,
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 break; 1376 break;
1374 case NAMED_PROPERTY: 1377 case NAMED_PROPERTY:
1375 if (expr->is_compound()) { 1378 if (expr->is_compound()) {
1376 // We need the receiver both on the stack and in the accumulator. 1379 // We need the receiver both on the stack and in the accumulator.
1377 VisitForAccumulatorValue(property->obj()); 1380 VisitForAccumulatorValue(property->obj());
1378 __ push(result_register()); 1381 __ push(result_register());
1379 } else { 1382 } else {
1380 VisitForStackValue(property->obj()); 1383 VisitForStackValue(property->obj());
1381 } 1384 }
1382 break; 1385 break;
1383 case KEYED_PROPERTY: 1386 case KEYED_PROPERTY: {
1384 if (expr->is_compound()) { 1387 if (expr->is_compound()) {
1385 VisitForStackValue(property->obj()); 1388 if (property->is_arguments_access()) {
1386 VisitForAccumulatorValue(property->key()); 1389 VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
1390 __ push(EmitSlotSearch(obj_proxy->var()->AsSlot(), rcx));
Kevin Millikin (Chromium) 2011/01/06 13:12:22 I know this is a duplication of the code on ia32,
William Hesse 2011/01/06 13:26:02 Fixed all places here and on ia32.
1391 __ Move(rax, property->key()->AsLiteral()->handle());
1392 } else {
1393 VisitForStackValue(property->obj());
1394 VisitForAccumulatorValue(property->key());
1395 }
1387 __ movq(rdx, Operand(rsp, 0)); 1396 __ movq(rdx, Operand(rsp, 0));
1388 __ push(rax); 1397 __ push(rax);
1389 } else { 1398 } else {
1390 VisitForStackValue(property->obj()); 1399 if (property->is_arguments_access()) {
1391 VisitForStackValue(property->key()); 1400 VariableProxy* obj_proxy = property->obj()->AsVariableProxy();
1401 __ push(EmitSlotSearch(obj_proxy->var()->AsSlot(), rcx));
1402 __ Push(property->key()->AsLiteral()->handle());
1403 } else {
1404 VisitForStackValue(property->obj());
1405 VisitForStackValue(property->key());
1406 }
1392 } 1407 }
1393 break; 1408 break;
1409 }
1394 } 1410 }
1395 1411
1396 if (expr->is_compound()) { 1412 if (expr->is_compound()) {
1397 { AccumulatorValueContext context(this); 1413 { AccumulatorValueContext context(this);
1398 switch (assign_type) { 1414 switch (assign_type) {
1399 case VARIABLE: 1415 case VARIABLE:
1400 EmitVariableLoad(expr->target()->AsVariableProxy()->var()); 1416 EmitVariableLoad(expr->target()->AsVariableProxy()->var());
1401 break; 1417 break;
1402 case NAMED_PROPERTY: 1418 case NAMED_PROPERTY:
1403 EmitNamedPropertyLoad(property); 1419 EmitNamedPropertyLoad(property);
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after
3112 } else { 3128 } else {
3113 // Reserve space for result of postfix operation. 3129 // Reserve space for result of postfix operation.
3114 if (expr->is_postfix() && !context()->IsEffect()) { 3130 if (expr->is_postfix() && !context()->IsEffect()) {
3115 __ Push(Smi::FromInt(0)); 3131 __ Push(Smi::FromInt(0));
3116 } 3132 }
3117 if (assign_type == NAMED_PROPERTY) { 3133 if (assign_type == NAMED_PROPERTY) {
3118 VisitForAccumulatorValue(prop->obj()); 3134 VisitForAccumulatorValue(prop->obj());
3119 __ push(rax); // Copy of receiver, needed for later store. 3135 __ push(rax); // Copy of receiver, needed for later store.
3120 EmitNamedPropertyLoad(prop); 3136 EmitNamedPropertyLoad(prop);
3121 } else { 3137 } else {
3122 VisitForStackValue(prop->obj()); 3138 if (prop->is_arguments_access()) {
3123 VisitForAccumulatorValue(prop->key()); 3139 VariableProxy* obj_proxy = prop->obj()->AsVariableProxy();
3140 __ push(EmitSlotSearch(obj_proxy->var()->AsSlot(), rcx));
3141 __ Move(rax, prop->key()->AsLiteral()->handle());
3142 } else {
3143 VisitForStackValue(prop->obj());
3144 VisitForAccumulatorValue(prop->key());
3145 }
3124 __ movq(rdx, Operand(rsp, 0)); // Leave receiver on stack 3146 __ movq(rdx, Operand(rsp, 0)); // Leave receiver on stack
3125 __ push(rax); // Copy of key, needed for later store. 3147 __ push(rax); // Copy of key, needed for later store.
3126 EmitKeyedPropertyLoad(prop); 3148 EmitKeyedPropertyLoad(prop);
3127 } 3149 }
3128 } 3150 }
3129 3151
3130 // We need a second deoptimization point after loading the value 3152 // We need a second deoptimization point after loading the value
3131 // in case evaluating the property load my have a side effect. 3153 // in case evaluating the property load my have a side effect.
3132 PrepareForBailout(expr->increment(), TOS_REG); 3154 PrepareForBailout(expr->increment(), TOS_REG);
3133 3155
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
3600 __ ret(0); 3622 __ ret(0);
3601 } 3623 }
3602 3624
3603 3625
3604 #undef __ 3626 #undef __
3605 3627
3606 3628
3607 } } // namespace v8::internal 3629 } } // namespace v8::internal
3608 3630
3609 #endif // V8_TARGET_ARCH_X64 3631 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698