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

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

Issue 15302004: Convert ToBooleanStub to a HydrogenStub. Currently just using HBranch, which is still fully impleme… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 7 years, 6 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/arm/full-codegen-arm.cc ('k') | src/code-stubs.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 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 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2229 __ stop("LBreak"); 2229 __ stop("LBreak");
2230 } 2230 }
2231 2231
2232 2232
2233 void LCodeGen::DoBranch(LBranch* instr) { 2233 void LCodeGen::DoBranch(LBranch* instr) {
2234 int true_block = chunk_->LookupDestination(instr->true_block_id()); 2234 int true_block = chunk_->LookupDestination(instr->true_block_id());
2235 int false_block = chunk_->LookupDestination(instr->false_block_id()); 2235 int false_block = chunk_->LookupDestination(instr->false_block_id());
2236 2236
2237 Representation r = instr->hydrogen()->value()->representation(); 2237 Representation r = instr->hydrogen()->value()->representation();
2238 if (r.IsInteger32() || r.IsSmi()) { 2238 if (r.IsInteger32() || r.IsSmi()) {
2239 ASSERT(!info()->IsStub());
2239 Register reg = ToRegister(instr->value()); 2240 Register reg = ToRegister(instr->value());
2240 __ cmp(reg, Operand::Zero()); 2241 __ cmp(reg, Operand::Zero());
2241 EmitBranch(true_block, false_block, ne); 2242 EmitBranch(true_block, false_block, ne);
2242 } else if (r.IsDouble()) { 2243 } else if (r.IsDouble()) {
2244 ASSERT(!info()->IsStub());
2243 DwVfpRegister reg = ToDoubleRegister(instr->value()); 2245 DwVfpRegister reg = ToDoubleRegister(instr->value());
2244 // Test the double value. Zero and NaN are false. 2246 // Test the double value. Zero and NaN are false.
2245 __ VFPCompareAndSetFlags(reg, 0.0); 2247 __ VFPCompareAndSetFlags(reg, 0.0);
2246 __ cmp(r0, r0, vs); // If NaN, set the Z flag. 2248 __ cmp(r0, r0, vs); // If NaN, set the Z flag.
2247 EmitBranch(true_block, false_block, ne); 2249 EmitBranch(true_block, false_block, ne);
2248 } else { 2250 } else {
2249 ASSERT(r.IsTagged()); 2251 ASSERT(r.IsTagged());
2250 Register reg = ToRegister(instr->value()); 2252 Register reg = ToRegister(instr->value());
2251 HType type = instr->hydrogen()->value()->type(); 2253 HType type = instr->hydrogen()->value()->type();
2252 if (type.IsBoolean()) { 2254 if (type.IsBoolean()) {
2255 ASSERT(!info()->IsStub());
2253 __ CompareRoot(reg, Heap::kTrueValueRootIndex); 2256 __ CompareRoot(reg, Heap::kTrueValueRootIndex);
2254 EmitBranch(true_block, false_block, eq); 2257 EmitBranch(true_block, false_block, eq);
2255 } else if (type.IsSmi()) { 2258 } else if (type.IsSmi()) {
2259 ASSERT(!info()->IsStub());
2256 __ cmp(reg, Operand::Zero()); 2260 __ cmp(reg, Operand::Zero());
2257 EmitBranch(true_block, false_block, ne); 2261 EmitBranch(true_block, false_block, ne);
2258 } else { 2262 } else {
2259 Label* true_label = chunk_->GetAssemblyLabel(true_block); 2263 Label* true_label = chunk_->GetAssemblyLabel(true_block);
2260 Label* false_label = chunk_->GetAssemblyLabel(false_block); 2264 Label* false_label = chunk_->GetAssemblyLabel(false_block);
2261 2265
2262 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); 2266 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types();
2263 // Avoid deopts in the case where we've never executed this path before. 2267 // Avoid deopts in the case where we've never executed this path before.
2264 if (expected.IsEmpty()) expected = ToBooleanStub::all_types(); 2268 if (expected.IsEmpty()) expected = ToBooleanStub::all_types();
2265 2269
(...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after
5985 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5989 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5986 __ ldr(result, FieldMemOperand(scratch, 5990 __ ldr(result, FieldMemOperand(scratch,
5987 FixedArray::kHeaderSize - kPointerSize)); 5991 FixedArray::kHeaderSize - kPointerSize));
5988 __ bind(&done); 5992 __ bind(&done);
5989 } 5993 }
5990 5994
5991 5995
5992 #undef __ 5996 #undef __
5993 5997
5994 } } // namespace v8::internal 5998 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698