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

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

Issue 1623004: Faster invocation of custom comparator function. (Closed)
Patch Set: Next round Created 10 years, 8 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
« no previous file with comments | « src/ia32/codegen-ia32.h ('k') | src/ia32/virtual-frame-ia32.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 6504 matching lines...) Expand 10 before | Expand all | Expand 10 after
6515 ASSERT_EQ(args->length(), 1); 6515 ASSERT_EQ(args->length(), 1);
6516 6516
6517 // Load the argument on the stack and call the stub. 6517 // Load the argument on the stack and call the stub.
6518 Load(args->at(0)); 6518 Load(args->at(0));
6519 NumberToStringStub stub; 6519 NumberToStringStub stub;
6520 Result result = frame_->CallStub(&stub, 1); 6520 Result result = frame_->CallStub(&stub, 1);
6521 frame_->Push(&result); 6521 frame_->Push(&result);
6522 } 6522 }
6523 6523
6524 6524
6525 void CodeGenerator::GenerateCallFunction(ZoneList<Expression*>* args) {
6526 Comment cmnt(masm_, "[ GenerateCallFunction");
6527
6528 ASSERT(args->length() >= 2);
6529
6530 int n_args = args->length() - 2; // for receiver and function.
6531 Load(args->at(0)); // receiver
6532 for (int i = 0; i < n_args; i++) {
6533 Load(args->at(i + 1));
6534 }
6535 Load(args->at(n_args + 1)); // function
6536 Result result = frame_->CallJSFunction(n_args);
6537 frame_->Push(&result);
6538 }
6539
6540
6525 // Generates the Math.pow method - only handles special cases and branches to 6541 // Generates the Math.pow method - only handles special cases and branches to
6526 // the runtime system if not.Please note - this function assumes that 6542 // the runtime system if not.Please note - this function assumes that
6527 // the callsite has executed ToNumber on both arguments and that the 6543 // the callsite has executed ToNumber on both arguments and that the
6528 // arguments are not the same identifier. 6544 // arguments are not the same identifier.
6529 void CodeGenerator::GenerateMathPow(ZoneList<Expression*>* args) { 6545 void CodeGenerator::GenerateMathPow(ZoneList<Expression*>* args) {
6530 ASSERT(args->length() == 2); 6546 ASSERT(args->length() == 2);
6531 Load(args->at(0)); 6547 Load(args->at(0));
6532 Load(args->at(1)); 6548 Load(args->at(1));
6533 if (!CpuFeatures::IsSupported(SSE2)) { 6549 if (!CpuFeatures::IsSupported(SSE2)) {
6534 Result res = frame_->CallRuntime(Runtime::kMath_pow, 2); 6550 Result res = frame_->CallRuntime(Runtime::kMath_pow, 2);
(...skipping 6117 matching lines...) Expand 10 before | Expand all | Expand 10 after
12652 12668
12653 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 12669 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
12654 // tagged as a small integer. 12670 // tagged as a small integer.
12655 __ bind(&runtime); 12671 __ bind(&runtime);
12656 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 12672 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
12657 } 12673 }
12658 12674
12659 #undef __ 12675 #undef __
12660 12676
12661 } } // namespace v8::internal 12677 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.h ('k') | src/ia32/virtual-frame-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698