OLD | NEW |
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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 ASSERT(!(left.is_constant() && left.handle()->IsString()) || | 1251 ASSERT(!(left.is_constant() && left.handle()->IsString()) || |
1252 left_is_string); | 1252 left_is_string); |
1253 ASSERT(!(right.is_constant() && right.handle()->IsString()) || | 1253 ASSERT(!(right.is_constant() && right.handle()->IsString()) || |
1254 right_is_string); | 1254 right_is_string); |
1255 if (left_is_string || right_is_string) { | 1255 if (left_is_string || right_is_string) { |
1256 frame_->Push(&left); | 1256 frame_->Push(&left); |
1257 frame_->Push(&right); | 1257 frame_->Push(&right); |
1258 Result answer; | 1258 Result answer; |
1259 if (left_is_string) { | 1259 if (left_is_string) { |
1260 if (right_is_string) { | 1260 if (right_is_string) { |
1261 // TODO(lrn): if both are constant strings | |
1262 // -- do a compile time cons, if allocation during codegen is allowed. | |
1263 StringAddStub stub(NO_STRING_CHECK_IN_STUB); | 1261 StringAddStub stub(NO_STRING_CHECK_IN_STUB); |
1264 answer = frame_->CallStub(&stub, 2); | 1262 answer = frame_->CallStub(&stub, 2); |
1265 } else { | 1263 } else { |
1266 answer = | 1264 answer = |
1267 frame_->InvokeBuiltin(Builtins::STRING_ADD_LEFT, CALL_FUNCTION, 2); | 1265 frame_->InvokeBuiltin(Builtins::STRING_ADD_LEFT, CALL_FUNCTION, 2); |
1268 } | 1266 } |
1269 } else if (right_is_string) { | 1267 } else if (right_is_string) { |
1270 answer = | 1268 answer = |
1271 frame_->InvokeBuiltin(Builtins::STRING_ADD_RIGHT, CALL_FUNCTION, 2); | 1269 frame_->InvokeBuiltin(Builtins::STRING_ADD_RIGHT, CALL_FUNCTION, 2); |
1272 } | 1270 } |
(...skipping 11775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13048 | 13046 |
13049 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 13047 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
13050 // tagged as a small integer. | 13048 // tagged as a small integer. |
13051 __ bind(&runtime); | 13049 __ bind(&runtime); |
13052 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 13050 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
13053 } | 13051 } |
13054 | 13052 |
13055 #undef __ | 13053 #undef __ |
13056 | 13054 |
13057 } } // namespace v8::internal | 13055 } } // namespace v8::internal |
OLD | NEW |