OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 230 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
231 } | 231 } |
232 | 232 |
233 // static | 233 // static |
234 Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags, | 234 Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags, |
235 PretenureFlag pretenure_flag) { | 235 PretenureFlag pretenure_flag) { |
236 StringAddStub stub(isolate, flags, pretenure_flag); | 236 StringAddStub stub(isolate, flags, pretenure_flag); |
237 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 237 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
238 } | 238 } |
239 | 239 |
240 | |
241 // static | |
242 Callable CodeFactory::StringCompare(Isolate* isolate) { | |
243 StringCompareStub stub(isolate); | |
244 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | |
245 } | |
246 | |
247 // static | 240 // static |
| 241 Callable CodeFactory::StringCompare(Isolate* isolate, Token::Value token) { |
| 242 switch (token) { |
| 243 case Token::EQ: |
| 244 case Token::EQ_STRICT: |
| 245 return StringEqual(isolate); |
| 246 case Token::NE: |
| 247 case Token::NE_STRICT: |
| 248 return StringNotEqual(isolate); |
| 249 case Token::LT: |
| 250 return StringLessThan(isolate); |
| 251 case Token::GT: |
| 252 return StringGreaterThan(isolate); |
| 253 case Token::LTE: |
| 254 return StringLessThanOrEqual(isolate); |
| 255 case Token::GTE: |
| 256 return StringGreaterThanOrEqual(isolate); |
| 257 default: |
| 258 break; |
| 259 } |
| 260 UNREACHABLE(); |
| 261 return StringEqual(isolate); |
| 262 } |
| 263 |
| 264 // static |
248 Callable CodeFactory::StringEqual(Isolate* isolate) { | 265 Callable CodeFactory::StringEqual(Isolate* isolate) { |
249 StringEqualStub stub(isolate); | 266 StringEqualStub stub(isolate); |
250 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 267 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
251 } | 268 } |
252 | 269 |
253 // static | 270 // static |
254 Callable CodeFactory::StringNotEqual(Isolate* isolate) { | 271 Callable CodeFactory::StringNotEqual(Isolate* isolate) { |
255 StringNotEqualStub stub(isolate); | 272 StringNotEqualStub stub(isolate); |
256 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 273 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
257 } | 274 } |
258 | 275 |
259 // static | 276 // static |
| 277 Callable CodeFactory::StringLessThan(Isolate* isolate) { |
| 278 StringLessThanStub stub(isolate); |
| 279 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
| 280 } |
| 281 |
| 282 // static |
| 283 Callable CodeFactory::StringLessThanOrEqual(Isolate* isolate) { |
| 284 StringLessThanOrEqualStub stub(isolate); |
| 285 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
| 286 } |
| 287 |
| 288 // static |
| 289 Callable CodeFactory::StringGreaterThan(Isolate* isolate) { |
| 290 StringGreaterThanStub stub(isolate); |
| 291 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
| 292 } |
| 293 |
| 294 // static |
| 295 Callable CodeFactory::StringGreaterThanOrEqual(Isolate* isolate) { |
| 296 StringGreaterThanOrEqualStub stub(isolate); |
| 297 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
| 298 } |
| 299 |
| 300 // static |
260 Callable CodeFactory::SubString(Isolate* isolate) { | 301 Callable CodeFactory::SubString(Isolate* isolate) { |
261 SubStringStub stub(isolate); | 302 SubStringStub stub(isolate); |
262 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 303 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
263 } | 304 } |
264 | 305 |
265 | 306 |
266 // static | 307 // static |
267 Callable CodeFactory::Typeof(Isolate* isolate) { | 308 Callable CodeFactory::Typeof(Isolate* isolate) { |
268 TypeofStub stub(isolate); | 309 TypeofStub stub(isolate); |
269 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 310 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // static | 452 // static |
412 Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) { | 453 Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) { |
413 // Note: If we ever use fpregs in the interpreter then we will need to | 454 // Note: If we ever use fpregs in the interpreter then we will need to |
414 // save fpregs too. | 455 // save fpregs too. |
415 CEntryStub stub(isolate, result_size, kDontSaveFPRegs, kArgvInRegister); | 456 CEntryStub stub(isolate, result_size, kDontSaveFPRegs, kArgvInRegister); |
416 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); | 457 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); |
417 } | 458 } |
418 | 459 |
419 } // namespace internal | 460 } // namespace internal |
420 } // namespace v8 | 461 } // namespace v8 |
OLD | NEW |