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

Side by Side Diff: src/x64/code-stubs-x64.h

Issue 6542060: X64: Refactor the string add in the type recording binary operation stub... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 10 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 | « src/ia32/code-stubs-ia32.cc ('k') | src/x64/code-stubs-x64.cc » ('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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 Register scratch); 353 Register scratch);
354 354
355 private: 355 private:
356 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); 356 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
357 }; 357 };
358 358
359 359
360 // Flag that indicates how to generate code for the stub StringAddStub. 360 // Flag that indicates how to generate code for the stub StringAddStub.
361 enum StringAddFlags { 361 enum StringAddFlags {
362 NO_STRING_ADD_FLAGS = 0, 362 NO_STRING_ADD_FLAGS = 0,
363 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. 363 // Omit left string check in stub (left is definitely a string).
364 NO_STRING_CHECK_LEFT_IN_STUB = 1 << 0,
365 // Omit right string check in stub (right is definitely a string).
366 NO_STRING_CHECK_RIGHT_IN_STUB = 1 << 1,
367 // Omit both string checks in stub.
368 NO_STRING_CHECK_IN_STUB =
369 NO_STRING_CHECK_LEFT_IN_STUB | NO_STRING_CHECK_RIGHT_IN_STUB
364 }; 370 };
365 371
366 372
367 class StringAddStub: public CodeStub { 373 class StringAddStub: public CodeStub {
368 public: 374 public:
369 explicit StringAddStub(StringAddFlags flags) { 375 explicit StringAddStub(StringAddFlags flags) : flags_(flags) {}
370 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0);
371 }
372 376
373 private: 377 private:
374 Major MajorKey() { return StringAdd; } 378 Major MajorKey() { return StringAdd; }
375 int MinorKey() { return string_check_ ? 0 : 1; } 379 int MinorKey() { return flags_; }
376 380
377 void Generate(MacroAssembler* masm); 381 void Generate(MacroAssembler* masm);
378 382
379 // Should the stub check whether arguments are strings? 383 void GenerateConvertArgument(MacroAssembler* masm,
380 bool string_check_; 384 int stack_offset,
385 Register arg,
386 Register scratch1,
387 Register scratch2,
388 Register scratch3,
389 Label* slow);
390
391 const StringAddFlags flags_;
381 }; 392 };
382 393
383 394
384 class SubStringStub: public CodeStub { 395 class SubStringStub: public CodeStub {
385 public: 396 public:
386 SubStringStub() {} 397 SubStringStub() {}
387 398
388 private: 399 private:
389 Major MajorKey() { return SubString; } 400 Major MajorKey() { return SubString; }
390 int MinorKey() { return 0; } 401 int MinorKey() { return 0; }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 bool load_elements_from_receiver, 502 bool load_elements_from_receiver,
492 bool key_is_untagged, 503 bool key_is_untagged,
493 Label* key_not_smi, 504 Label* key_not_smi,
494 Label* value_not_smi, 505 Label* value_not_smi,
495 Label* not_pixel_array, 506 Label* not_pixel_array,
496 Label* out_of_range); 507 Label* out_of_range);
497 508
498 } } // namespace v8::internal 509 } } // namespace v8::internal
499 510
500 #endif // V8_X64_CODE_STUBS_X64_H_ 511 #endif // V8_X64_CODE_STUBS_X64_H_
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698