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

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

Issue 11108011: Ensure that we do not accidentally emit debug code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed indentation Created 8 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/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 2573
2574 VisitForAccumulatorValue(args->at(0)); 2574 VisitForAccumulatorValue(args->at(0));
2575 2575
2576 Label materialize_true, materialize_false; 2576 Label materialize_true, materialize_false;
2577 Label* if_true = NULL; 2577 Label* if_true = NULL;
2578 Label* if_false = NULL; 2578 Label* if_false = NULL;
2579 Label* fall_through = NULL; 2579 Label* fall_through = NULL;
2580 context()->PrepareTest(&materialize_true, &materialize_false, 2580 context()->PrepareTest(&materialize_true, &materialize_false,
2581 &if_true, &if_false, &fall_through); 2581 &if_true, &if_false, &fall_through);
2582 2582
2583 if (generate_debug_code_) __ AbortIfSmi(rax); 2583 __ AssertNotSmi(rax);
2584 2584
2585 // Check whether this map has already been checked to be safe for default 2585 // Check whether this map has already been checked to be safe for default
2586 // valueOf. 2586 // valueOf.
2587 __ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset)); 2587 __ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset));
2588 __ testb(FieldOperand(rbx, Map::kBitField2Offset), 2588 __ testb(FieldOperand(rbx, Map::kBitField2Offset),
2589 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf)); 2589 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf));
2590 __ j(not_zero, if_true); 2590 __ j(not_zero, if_true);
2591 2591
2592 // Check for fast case object. Generate false result for slow case object. 2592 // Check for fast case object. Generate false result for slow case object.
2593 __ movq(rcx, FieldOperand(rax, JSObject::kPropertiesOffset)); 2593 __ movq(rcx, FieldOperand(rax, JSObject::kPropertiesOffset));
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2802 __ movq(rbx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); 2802 __ movq(rbx, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
2803 __ Cmp(Operand(rbx, StandardFrameConstants::kContextOffset), 2803 __ Cmp(Operand(rbx, StandardFrameConstants::kContextOffset),
2804 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); 2804 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2805 __ j(not_equal, &exit, Label::kNear); 2805 __ j(not_equal, &exit, Label::kNear);
2806 2806
2807 // Arguments adaptor case: Read the arguments length from the 2807 // Arguments adaptor case: Read the arguments length from the
2808 // adaptor frame. 2808 // adaptor frame.
2809 __ movq(rax, Operand(rbx, ArgumentsAdaptorFrameConstants::kLengthOffset)); 2809 __ movq(rax, Operand(rbx, ArgumentsAdaptorFrameConstants::kLengthOffset));
2810 2810
2811 __ bind(&exit); 2811 __ bind(&exit);
2812 if (generate_debug_code_) __ AbortIfNotSmi(rax); 2812 __ AssertSmi(rax);
2813 context()->Plug(rax); 2813 context()->Plug(rax);
2814 } 2814 }
2815 2815
2816 2816
2817 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { 2817 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
2818 ZoneList<Expression*>* args = expr->arguments(); 2818 ZoneList<Expression*>* args = expr->arguments();
2819 ASSERT(args->length() == 1); 2819 ASSERT(args->length() == 1);
2820 Label done, null, function, non_function_constructor; 2820 Label done, null, function, non_function_constructor;
2821 2821
2822 VisitForAccumulatorValue(args->at(0)); 2822 VisitForAccumulatorValue(args->at(0));
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
3452 3452
3453 context()->Plug(if_true, if_false); 3453 context()->Plug(if_true, if_false);
3454 } 3454 }
3455 3455
3456 3456
3457 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) { 3457 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) {
3458 ZoneList<Expression*>* args = expr->arguments(); 3458 ZoneList<Expression*>* args = expr->arguments();
3459 ASSERT(args->length() == 1); 3459 ASSERT(args->length() == 1);
3460 VisitForAccumulatorValue(args->at(0)); 3460 VisitForAccumulatorValue(args->at(0));
3461 3461
3462 __ AbortIfNotString(rax); 3462 __ AssertString(rax);
3463 3463
3464 __ movl(rax, FieldOperand(rax, String::kHashFieldOffset)); 3464 __ movl(rax, FieldOperand(rax, String::kHashFieldOffset));
3465 ASSERT(String::kHashShift >= kSmiTagSize); 3465 ASSERT(String::kHashShift >= kSmiTagSize);
3466 __ IndexFromHash(rax, rax); 3466 __ IndexFromHash(rax, rax);
3467 3467
3468 context()->Plug(rax); 3468 context()->Plug(rax);
3469 } 3469 }
3470 3470
3471 3471
3472 void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) { 3472 void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) {
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
4514 *context_length = 0; 4514 *context_length = 0;
4515 return previous_; 4515 return previous_;
4516 } 4516 }
4517 4517
4518 4518
4519 #undef __ 4519 #undef __
4520 4520
4521 } } // namespace v8::internal 4521 } } // namespace v8::internal
4522 4522
4523 #endif // V8_TARGET_ARCH_X64 4523 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698