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

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

Issue 13290: Fixed bug in large switch tables on arm. (Closed)
Patch Set: Addressed review comments Created 12 years 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
« no previous file with comments | « src/assembler-arm.h ('k') | src/constants-arm.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 __ add(r0, r0, Operand(Smi::FromInt(1))); 1340 __ add(r0, r0, Operand(Smi::FromInt(1)));
1341 } 1341 }
1342 } else { 1342 } else {
1343 __ sub(r0, r0, Operand(Smi::FromInt(min_index))); 1343 __ sub(r0, r0, Operand(Smi::FromInt(min_index)));
1344 } 1344 }
1345 } 1345 }
1346 __ tst(r0, Operand(0x80000000 | kSmiTagMask)); 1346 __ tst(r0, Operand(0x80000000 | kSmiTagMask));
1347 __ b(ne, fail_label); 1347 __ b(ne, fail_label);
1348 __ cmp(r0, Operand(Smi::FromInt(range))); 1348 __ cmp(r0, Operand(Smi::FromInt(range)));
1349 __ b(ge, fail_label); 1349 __ b(ge, fail_label);
1350 __ add(pc, pc, Operand(r0, LSL, 2 - kSmiTagSize)); 1350 __ SmiJumpTable(r0, case_targets);
1351 // One extra instruction offsets the table, so the table's start address is
1352 // the pc-register at the above add.
1353 __ stop("Unreachable: Switch table alignment");
1354
1355 // Table containing branch operations.
1356 for (int i = 0; i < range; i++) {
1357 __ b(case_targets[i]);
1358 }
1359 1351
1360 GenerateFastCaseSwitchCases(node, case_labels); 1352 GenerateFastCaseSwitchCases(node, case_labels);
1361 } 1353 }
1362 1354
1363 1355
1364 void CodeGenerator::VisitSwitchStatement(SwitchStatement* node) { 1356 void CodeGenerator::VisitSwitchStatement(SwitchStatement* node) {
1365 Comment cmnt(masm_, "[ SwitchStatement"); 1357 Comment cmnt(masm_, "[ SwitchStatement");
1366 if (FLAG_debug_info) RecordStatementPosition(node); 1358 if (FLAG_debug_info) RecordStatementPosition(node);
1367 node->set_break_stack_height(break_stack_height_); 1359 node->set_break_stack_height(break_stack_height_);
1368 1360
(...skipping 2970 matching lines...) Expand 10 before | Expand all | Expand 10 after
4339 __ mov(r2, Operand(0)); 4331 __ mov(r2, Operand(0));
4340 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); 4332 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
4341 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), 4333 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)),
4342 RelocInfo::CODE_TARGET); 4334 RelocInfo::CODE_TARGET);
4343 } 4335 }
4344 4336
4345 4337
4346 #undef __ 4338 #undef __
4347 4339
4348 } } // namespace v8::internal 4340 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler-arm.h ('k') | src/constants-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698