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

Side by Side Diff: src/ia32/full-codegen-ia32.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/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.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 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 2600
2601 VisitForAccumulatorValue(args->at(0)); 2601 VisitForAccumulatorValue(args->at(0));
2602 2602
2603 Label materialize_true, materialize_false; 2603 Label materialize_true, materialize_false;
2604 Label* if_true = NULL; 2604 Label* if_true = NULL;
2605 Label* if_false = NULL; 2605 Label* if_false = NULL;
2606 Label* fall_through = NULL; 2606 Label* fall_through = NULL;
2607 context()->PrepareTest(&materialize_true, &materialize_false, 2607 context()->PrepareTest(&materialize_true, &materialize_false,
2608 &if_true, &if_false, &fall_through); 2608 &if_true, &if_false, &fall_through);
2609 2609
2610 if (generate_debug_code_) __ AbortIfSmi(eax); 2610 __ AssertNotSmi(eax);
2611 2611
2612 // Check whether this map has already been checked to be safe for default 2612 // Check whether this map has already been checked to be safe for default
2613 // valueOf. 2613 // valueOf.
2614 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); 2614 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
2615 __ test_b(FieldOperand(ebx, Map::kBitField2Offset), 2615 __ test_b(FieldOperand(ebx, Map::kBitField2Offset),
2616 1 << Map::kStringWrapperSafeForDefaultValueOf); 2616 1 << Map::kStringWrapperSafeForDefaultValueOf);
2617 __ j(not_zero, if_true); 2617 __ j(not_zero, if_true);
2618 2618
2619 // Check for fast case object. Return false for slow case objects. 2619 // Check for fast case object. Return false for slow case objects.
2620 __ mov(ecx, FieldOperand(eax, JSObject::kPropertiesOffset)); 2620 __ mov(ecx, FieldOperand(eax, JSObject::kPropertiesOffset));
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 __ mov(ebx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); 2831 __ mov(ebx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
2832 __ cmp(Operand(ebx, StandardFrameConstants::kContextOffset), 2832 __ cmp(Operand(ebx, StandardFrameConstants::kContextOffset),
2833 Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 2833 Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
2834 __ j(not_equal, &exit); 2834 __ j(not_equal, &exit);
2835 2835
2836 // Arguments adaptor case: Read the arguments length from the 2836 // Arguments adaptor case: Read the arguments length from the
2837 // adaptor frame. 2837 // adaptor frame.
2838 __ mov(eax, Operand(ebx, ArgumentsAdaptorFrameConstants::kLengthOffset)); 2838 __ mov(eax, Operand(ebx, ArgumentsAdaptorFrameConstants::kLengthOffset));
2839 2839
2840 __ bind(&exit); 2840 __ bind(&exit);
2841 if (generate_debug_code_) __ AbortIfNotSmi(eax); 2841 __ AssertSmi(eax);
2842 context()->Plug(eax); 2842 context()->Plug(eax);
2843 } 2843 }
2844 2844
2845 2845
2846 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { 2846 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
2847 ZoneList<Expression*>* args = expr->arguments(); 2847 ZoneList<Expression*>* args = expr->arguments();
2848 ASSERT(args->length() == 1); 2848 ASSERT(args->length() == 1);
2849 Label done, null, function, non_function_constructor; 2849 Label done, null, function, non_function_constructor;
2850 2850
2851 VisitForAccumulatorValue(args->at(0)); 2851 VisitForAccumulatorValue(args->at(0));
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3455 context()->Plug(eax); 3455 context()->Plug(eax);
3456 } 3456 }
3457 3457
3458 3458
3459 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { 3459 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) {
3460 ZoneList<Expression*>* args = expr->arguments(); 3460 ZoneList<Expression*>* args = expr->arguments();
3461 ASSERT(args->length() == 1); 3461 ASSERT(args->length() == 1);
3462 3462
3463 VisitForAccumulatorValue(args->at(0)); 3463 VisitForAccumulatorValue(args->at(0));
3464 3464
3465 if (generate_debug_code_) { 3465 __ AssertString(eax);
3466 __ AbortIfNotString(eax);
3467 }
3468 3466
3469 Label materialize_true, materialize_false; 3467 Label materialize_true, materialize_false;
3470 Label* if_true = NULL; 3468 Label* if_true = NULL;
3471 Label* if_false = NULL; 3469 Label* if_false = NULL;
3472 Label* fall_through = NULL; 3470 Label* fall_through = NULL;
3473 context()->PrepareTest(&materialize_true, &materialize_false, 3471 context()->PrepareTest(&materialize_true, &materialize_false,
3474 &if_true, &if_false, &fall_through); 3472 &if_true, &if_false, &fall_through);
3475 3473
3476 __ test(FieldOperand(eax, String::kHashFieldOffset), 3474 __ test(FieldOperand(eax, String::kHashFieldOffset),
3477 Immediate(String::kContainsCachedArrayIndexMask)); 3475 Immediate(String::kContainsCachedArrayIndexMask));
3478 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 3476 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3479 Split(zero, if_true, if_false, fall_through); 3477 Split(zero, if_true, if_false, fall_through);
3480 3478
3481 context()->Plug(if_true, if_false); 3479 context()->Plug(if_true, if_false);
3482 } 3480 }
3483 3481
3484 3482
3485 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) { 3483 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) {
3486 ZoneList<Expression*>* args = expr->arguments(); 3484 ZoneList<Expression*>* args = expr->arguments();
3487 ASSERT(args->length() == 1); 3485 ASSERT(args->length() == 1);
3488 VisitForAccumulatorValue(args->at(0)); 3486 VisitForAccumulatorValue(args->at(0));
3489 3487
3490 __ AbortIfNotString(eax); 3488 __ AssertString(eax);
3491 3489
3492 __ mov(eax, FieldOperand(eax, String::kHashFieldOffset)); 3490 __ mov(eax, FieldOperand(eax, String::kHashFieldOffset));
3493 __ IndexFromHash(eax, eax); 3491 __ IndexFromHash(eax, eax);
3494 3492
3495 context()->Plug(eax); 3493 context()->Plug(eax);
3496 } 3494 }
3497 3495
3498 3496
3499 void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) { 3497 void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) {
3500 Label bailout, done, one_char_separator, long_separator, 3498 Label bailout, done, one_char_separator, long_separator,
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
4517 *stack_depth = 0; 4515 *stack_depth = 0;
4518 *context_length = 0; 4516 *context_length = 0;
4519 return previous_; 4517 return previous_;
4520 } 4518 }
4521 4519
4522 #undef __ 4520 #undef __
4523 4521
4524 } } // namespace v8::internal 4522 } } // namespace v8::internal
4525 4523
4526 #endif // V8_TARGET_ARCH_IA32 4524 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698