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

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

Issue 3338007: Handle argument conversion in StringAddStub. (Closed)
Patch Set: Test added Created 10 years, 3 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/code-stubs-ia32.cc ('k') | test/mjsunit/binary-op-newspace.js » ('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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 right_is_string); 1404 right_is_string);
1405 if (left_is_string || right_is_string) { 1405 if (left_is_string || right_is_string) {
1406 frame_->Push(&left); 1406 frame_->Push(&left);
1407 frame_->Push(&right); 1407 frame_->Push(&right);
1408 Result answer; 1408 Result answer;
1409 if (left_is_string) { 1409 if (left_is_string) {
1410 if (right_is_string) { 1410 if (right_is_string) {
1411 StringAddStub stub(NO_STRING_CHECK_IN_STUB); 1411 StringAddStub stub(NO_STRING_CHECK_IN_STUB);
1412 answer = frame_->CallStub(&stub, 2); 1412 answer = frame_->CallStub(&stub, 2);
1413 } else { 1413 } else {
1414 answer = 1414 StringAddStub stub(NO_STRING_CHECK_LEFT_IN_STUB);
1415 frame_->InvokeBuiltin(Builtins::STRING_ADD_LEFT, CALL_FUNCTION, 2); 1415 answer = frame_->CallStub(&stub, 2);
1416 } 1416 }
1417 } else if (right_is_string) { 1417 } else if (right_is_string) {
1418 answer = 1418 StringAddStub stub(NO_STRING_CHECK_RIGHT_IN_STUB);
1419 frame_->InvokeBuiltin(Builtins::STRING_ADD_RIGHT, CALL_FUNCTION, 2); 1419 answer = frame_->CallStub(&stub, 2);
1420 } 1420 }
1421 answer.set_type_info(TypeInfo::String()); 1421 answer.set_type_info(TypeInfo::String());
1422 frame_->Push(&answer); 1422 frame_->Push(&answer);
1423 return; 1423 return;
1424 } 1424 }
1425 // Neither operand is known to be a string. 1425 // Neither operand is known to be a string.
1426 } 1426 }
1427 1427
1428 bool left_is_smi_constant = left.is_constant() && left.handle()->IsSmi(); 1428 bool left_is_smi_constant = left.is_constant() && left.handle()->IsSmi();
1429 bool left_is_non_smi_constant = left.is_constant() && !left.handle()->IsSmi(); 1429 bool left_is_non_smi_constant = left.is_constant() && !left.handle()->IsSmi();
(...skipping 8603 matching lines...) Expand 10 before | Expand all | Expand 10 after
10033 masm.GetCode(&desc); 10033 masm.GetCode(&desc);
10034 // Call the function from C++. 10034 // Call the function from C++.
10035 return FUNCTION_CAST<MemCopyFunction>(buffer); 10035 return FUNCTION_CAST<MemCopyFunction>(buffer);
10036 } 10036 }
10037 10037
10038 #undef __ 10038 #undef __
10039 10039
10040 } } // namespace v8::internal 10040 } } // namespace v8::internal
10041 10041
10042 #endif // V8_TARGET_ARCH_IA32 10042 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | test/mjsunit/binary-op-newspace.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698