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

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

Issue 7544012: Implement type recording for ToBoolean on x64. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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
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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 __ test(reg, Operand(reg)); 1386 __ test(reg, Operand(reg));
1387 EmitBranch(true_block, false_block, not_zero); 1387 EmitBranch(true_block, false_block, not_zero);
1388 } else if (r.IsDouble()) { 1388 } else if (r.IsDouble()) {
1389 XMMRegister reg = ToDoubleRegister(instr->InputAt(0)); 1389 XMMRegister reg = ToDoubleRegister(instr->InputAt(0));
1390 __ xorps(xmm0, xmm0); 1390 __ xorps(xmm0, xmm0);
1391 __ ucomisd(reg, xmm0); 1391 __ ucomisd(reg, xmm0);
1392 EmitBranch(true_block, false_block, not_equal); 1392 EmitBranch(true_block, false_block, not_equal);
1393 } else { 1393 } else {
1394 ASSERT(r.IsTagged()); 1394 ASSERT(r.IsTagged());
1395 Register reg = ToRegister(instr->InputAt(0)); 1395 Register reg = ToRegister(instr->InputAt(0));
1396 if (instr->hydrogen()->value()->type().IsBoolean()) { 1396 HType type = instr->hydrogen()->value()->type();
1397 if (type.IsBoolean()) {
1397 __ cmp(reg, factory()->true_value()); 1398 __ cmp(reg, factory()->true_value());
1398 EmitBranch(true_block, false_block, equal); 1399 EmitBranch(true_block, false_block, equal);
1400 } else if (type.IsSmi()) {
1401 __ test(reg, Operand(reg));
1402 EmitBranch(true_block, false_block, not_equal);
1399 } else { 1403 } else {
1400 Label* true_label = chunk_->GetAssemblyLabel(true_block); 1404 Label* true_label = chunk_->GetAssemblyLabel(true_block);
1401 Label* false_label = chunk_->GetAssemblyLabel(false_block); 1405 Label* false_label = chunk_->GetAssemblyLabel(false_block);
1402 1406
1403 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); 1407 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types();
1404 // Avoid deopts in the case where we've never executed this path before. 1408 // Avoid deopts in the case where we've never executed this path before.
1405 if (expected.IsEmpty()) expected = ToBooleanStub::all_types(); 1409 if (expected.IsEmpty()) expected = ToBooleanStub::all_types();
1406 1410
1407 if (expected.Contains(ToBooleanStub::UNDEFINED)) { 1411 if (expected.Contains(ToBooleanStub::UNDEFINED)) {
1408 // undefined -> false. 1412 // undefined -> false.
(...skipping 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after
4395 env->deoptimization_index()); 4399 env->deoptimization_index());
4396 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4400 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4397 } 4401 }
4398 4402
4399 4403
4400 #undef __ 4404 #undef __
4401 4405
4402 } } // namespace v8::internal 4406 } } // namespace v8::internal
4403 4407
4404 #endif // V8_TARGET_ARCH_IA32 4408 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698