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

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

Issue 11801003: MIPS: Enable type feedback for branch statement and function call (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | « no previous file | src/mips/macro-assembler-mips.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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 } 668 }
669 } 669 }
670 670
671 671
672 void FullCodeGenerator::DoTest(Expression* condition, 672 void FullCodeGenerator::DoTest(Expression* condition,
673 Label* if_true, 673 Label* if_true,
674 Label* if_false, 674 Label* if_false,
675 Label* fall_through) { 675 Label* fall_through) {
676 if (CpuFeatures::IsSupported(FPU)) { 676 if (CpuFeatures::IsSupported(FPU)) {
677 ToBooleanStub stub(result_register()); 677 ToBooleanStub stub(result_register());
678 __ CallStub(&stub); 678 __ CallStub(&stub, condition->test_id());
679 __ mov(at, zero_reg); 679 __ mov(at, zero_reg);
680 } else { 680 } else {
681 // Call the runtime to find the boolean value of the source and then 681 // Call the runtime to find the boolean value of the source and then
682 // translate it into control flow to the pair of labels. 682 // translate it into control flow to the pair of labels.
683 __ push(result_register()); 683 __ push(result_register());
684 __ CallRuntime(Runtime::kToBool, 1); 684 __ CallRuntime(Runtime::kToBool, 1);
685 __ LoadRoot(at, Heap::kFalseValueRootIndex); 685 __ LoadRoot(at, Heap::kFalseValueRootIndex);
686 } 686 }
687 Split(ne, v0, Operand(at), if_true, if_false, fall_through); 687 Split(ne, v0, Operand(at), if_true, if_false, fall_through);
688 } 688 }
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after
2346 flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET); 2346 flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET);
2347 Handle<Object> uninitialized = 2347 Handle<Object> uninitialized =
2348 TypeFeedbackCells::UninitializedSentinel(isolate()); 2348 TypeFeedbackCells::UninitializedSentinel(isolate());
2349 Handle<JSGlobalPropertyCell> cell = 2349 Handle<JSGlobalPropertyCell> cell =
2350 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized); 2350 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
2351 RecordTypeFeedbackCell(expr->CallFeedbackId(), cell); 2351 RecordTypeFeedbackCell(expr->CallFeedbackId(), cell);
2352 __ li(a2, Operand(cell)); 2352 __ li(a2, Operand(cell));
2353 2353
2354 CallFunctionStub stub(arg_count, flags); 2354 CallFunctionStub stub(arg_count, flags);
2355 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 2355 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
2356 __ CallStub(&stub); 2356 __ CallStub(&stub, expr->CallFeedbackId());
2357 RecordJSReturnSite(expr); 2357 RecordJSReturnSite(expr);
2358 // Restore context register. 2358 // Restore context register.
2359 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2359 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2360 context()->DropAndPlug(1, v0); 2360 context()->DropAndPlug(1, v0);
2361 } 2361 }
2362 2362
2363 2363
2364 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { 2364 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
2365 // Push copy of the first argument or undefined if it doesn't exist. 2365 // Push copy of the first argument or undefined if it doesn't exist.
2366 if (arg_count > 0) { 2366 if (arg_count > 0) {
(...skipping 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after
4576 *context_length = 0; 4576 *context_length = 0;
4577 return previous_; 4577 return previous_;
4578 } 4578 }
4579 4579
4580 4580
4581 #undef __ 4581 #undef __
4582 4582
4583 } } // namespace v8::internal 4583 } } // namespace v8::internal
4584 4584
4585 #endif // V8_TARGET_ARCH_MIPS 4585 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698