OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 // GC. This means that we must be statically sure that no GC can occur while | 173 // GC. This means that we must be statically sure that no GC can occur while |
174 // they are running. If that is the case they should override this to return | 174 // they are running. If that is the case they should override this to return |
175 // true, which will cause an assertion if we try to call something that can | 175 // true, which will cause an assertion if we try to call something that can |
176 // GC or if we try to put a stack frame on top of the junk, which would not | 176 // GC or if we try to put a stack frame on top of the junk, which would not |
177 // result in a traversable stack. | 177 // result in a traversable stack. |
178 virtual bool SometimesSetsUpAFrame() { return true; } | 178 virtual bool SometimesSetsUpAFrame() { return true; } |
179 | 179 |
180 // Lookup the code in the (possibly custom) cache. | 180 // Lookup the code in the (possibly custom) cache. |
181 bool FindCodeInCache(Code** code_out); | 181 bool FindCodeInCache(Code** code_out); |
182 | 182 |
183 virtual void InitializeInterfaceDescriptor( | 183 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() { |
mvstanton
2014/09/08 14:58:38
Good, I'll be able to add implementations for the
| |
184 CodeStubInterfaceDescriptor* descriptor) {} | 184 UNREACHABLE(); // Default returns an uninitialized descriptor. |
185 return CallInterfaceDescriptor(); | |
186 } | |
185 | 187 |
186 static void InitializeInterfaceDescriptor(Isolate* isolate, uint32_t key, | 188 virtual void InitializeDescriptor(CodeStubDescriptor* descriptor) {} |
187 CodeStubInterfaceDescriptor* desc); | 189 |
190 static void InitializeDescriptor(Isolate* isolate, uint32_t key, | |
191 CodeStubDescriptor* desc); | |
188 | 192 |
189 // Returns information for computing the number key. | 193 // Returns information for computing the number key. |
190 virtual Major MajorKey() const = 0; | 194 virtual Major MajorKey() const = 0; |
191 uint32_t MinorKey() const { return minor_key_; } | 195 uint32_t MinorKey() const { return minor_key_; } |
192 | 196 |
193 virtual InlineCacheState GetICState() const { return UNINITIALIZED; } | 197 virtual InlineCacheState GetICState() const { return UNINITIALIZED; } |
194 virtual ExtraICState GetExtraICState() const { return kNoExtraICState; } | 198 virtual ExtraICState GetExtraICState() const { return kNoExtraICState; } |
195 virtual Code::StubType GetStubType() { | 199 virtual Code::StubType GetStubType() { |
196 return Code::NORMAL; | 200 return Code::NORMAL; |
197 } | 201 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 }; \ | 290 }; \ |
287 DEFINE_CODE_STUB_BASE(NAME##Stub, SUPER) | 291 DEFINE_CODE_STUB_BASE(NAME##Stub, SUPER) |
288 | 292 |
289 | 293 |
290 #define DEFINE_PLATFORM_CODE_STUB(NAME, SUPER) \ | 294 #define DEFINE_PLATFORM_CODE_STUB(NAME, SUPER) \ |
291 private: \ | 295 private: \ |
292 virtual void Generate(MacroAssembler* masm) OVERRIDE; \ | 296 virtual void Generate(MacroAssembler* masm) OVERRIDE; \ |
293 DEFINE_CODE_STUB(NAME, SUPER) | 297 DEFINE_CODE_STUB(NAME, SUPER) |
294 | 298 |
295 | 299 |
296 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ | 300 #define DEFINE_HYDROGEN_CODE_STUB(NAME, SUPER) \ |
297 public: \ | 301 public: \ |
298 virtual void InitializeInterfaceDescriptor( \ | 302 virtual void InitializeDescriptor(CodeStubDescriptor* descriptor) OVERRIDE; \ |
299 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; \ | 303 virtual Handle<Code> GenerateCode() OVERRIDE; \ |
300 virtual Handle<Code> GenerateCode() OVERRIDE; \ | |
301 DEFINE_CODE_STUB(NAME, SUPER) | 304 DEFINE_CODE_STUB(NAME, SUPER) |
302 | 305 |
303 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ | 306 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ |
304 public: \ | 307 public: \ |
305 virtual Handle<Code> GenerateCode() OVERRIDE; \ | 308 virtual Handle<Code> GenerateCode() OVERRIDE; \ |
306 DEFINE_CODE_STUB(NAME, SUPER) | 309 DEFINE_CODE_STUB(NAME, SUPER) |
307 | 310 |
311 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ | |
312 public: \ | |
313 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { \ | |
314 return NAME##Descriptor(isolate()); \ | |
315 } | |
316 | |
308 | 317 |
309 class PlatformCodeStub : public CodeStub { | 318 class PlatformCodeStub : public CodeStub { |
310 public: | 319 public: |
311 // Retrieve the code for the stub. Generate the code if needed. | 320 // Retrieve the code for the stub. Generate the code if needed. |
312 virtual Handle<Code> GenerateCode() OVERRIDE; | 321 virtual Handle<Code> GenerateCode() OVERRIDE; |
313 | 322 |
314 virtual Code::Kind GetCodeKind() const { return Code::STUB; } | 323 virtual Code::Kind GetCodeKind() const { return Code::STUB; } |
315 | 324 |
316 protected: | 325 protected: |
317 explicit PlatformCodeStub(Isolate* isolate) : CodeStub(isolate) {} | 326 explicit PlatformCodeStub(Isolate* isolate) : CodeStub(isolate) {} |
318 | 327 |
319 // Generates the assembler code for the stub. | 328 // Generates the assembler code for the stub. |
320 virtual void Generate(MacroAssembler* masm) = 0; | 329 virtual void Generate(MacroAssembler* masm) = 0; |
321 | 330 |
322 DEFINE_CODE_STUB_BASE(PlatformCodeStub, CodeStub); | 331 DEFINE_CODE_STUB_BASE(PlatformCodeStub, CodeStub); |
323 }; | 332 }; |
324 | 333 |
325 | 334 |
326 enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE }; | 335 enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE }; |
327 enum HandlerArgumentsMode { DONT_PASS_ARGUMENTS, PASS_ARGUMENTS }; | 336 enum HandlerArgumentsMode { DONT_PASS_ARGUMENTS, PASS_ARGUMENTS }; |
328 | 337 |
329 | 338 |
330 class CodeStubInterfaceDescriptor { | 339 class CodeStubDescriptor { |
331 public: | 340 public: |
332 explicit CodeStubInterfaceDescriptor(CodeStub* stub); | 341 explicit CodeStubDescriptor(CodeStub* stub); |
333 | 342 |
334 CodeStubInterfaceDescriptor(Isolate* isolate, uint32_t stub_key); | 343 CodeStubDescriptor(Isolate* isolate, uint32_t stub_key); |
335 | 344 |
336 void Initialize(CodeStub::Major major, | 345 void Initialize(Address deoptimization_handler = NULL, |
337 CallInterfaceDescriptor call_descriptor, | |
338 Address deoptimization_handler = NULL, | |
339 int hint_stack_parameter_count = -1, | 346 int hint_stack_parameter_count = -1, |
340 StubFunctionMode function_mode = NOT_JS_FUNCTION_STUB_MODE); | 347 StubFunctionMode function_mode = NOT_JS_FUNCTION_STUB_MODE); |
341 void Initialize(CodeStub::Major major, | 348 void Initialize(Register stack_parameter_count, |
342 CallInterfaceDescriptor call_descriptor, | |
343 Register stack_parameter_count, | |
344 Address deoptimization_handler = NULL, | 349 Address deoptimization_handler = NULL, |
345 int hint_stack_parameter_count = -1, | 350 int hint_stack_parameter_count = -1, |
346 StubFunctionMode function_mode = NOT_JS_FUNCTION_STUB_MODE, | 351 StubFunctionMode function_mode = NOT_JS_FUNCTION_STUB_MODE, |
347 HandlerArgumentsMode handler_mode = DONT_PASS_ARGUMENTS); | 352 HandlerArgumentsMode handler_mode = DONT_PASS_ARGUMENTS); |
348 | 353 |
349 void SetMissHandler(ExternalReference handler) { | 354 void SetMissHandler(ExternalReference handler) { |
350 miss_handler_ = handler; | 355 miss_handler_ = handler; |
351 has_miss_handler_ = true; | 356 has_miss_handler_ = true; |
352 // Our miss handler infrastructure doesn't currently support | 357 // Our miss handler infrastructure doesn't currently support |
353 // variable stack parameter counts. | 358 // variable stack parameter counts. |
354 DCHECK(!stack_parameter_count_.is_valid()); | 359 DCHECK(!stack_parameter_count_.is_valid()); |
355 } | 360 } |
356 | 361 |
357 bool IsInitialized() const { return call_descriptor_.IsInitialized(); } | 362 void set_call_descriptor(CallInterfaceDescriptor d) { call_descriptor_ = d; } |
358 | |
359 CallInterfaceDescriptor call_descriptor() const { return call_descriptor_; } | 363 CallInterfaceDescriptor call_descriptor() const { return call_descriptor_; } |
360 | 364 |
361 int GetEnvironmentLength() const { | |
362 return call_descriptor().GetEnvironmentLength(); | |
363 } | |
364 | |
365 int GetRegisterParameterCount() const { | |
366 return call_descriptor().GetRegisterParameterCount(); | |
367 } | |
368 | |
369 Register GetParameterRegister(int index) const { | |
370 return call_descriptor().GetParameterRegister(index); | |
371 } | |
372 | |
373 Representation GetParameterRepresentation(int index) const { | |
374 return call_descriptor().GetParameterRepresentation(index); | |
375 } | |
376 | |
377 int GetEnvironmentParameterCount() const { | 365 int GetEnvironmentParameterCount() const { |
378 return call_descriptor().GetEnvironmentParameterCount(); | 366 return call_descriptor().GetEnvironmentParameterCount(); |
379 } | 367 } |
380 | 368 |
381 Register GetEnvironmentParameterRegister(int index) const { | |
382 return call_descriptor().GetEnvironmentParameterRegister(index); | |
383 } | |
384 | |
385 Representation GetEnvironmentParameterRepresentation(int index) const { | 369 Representation GetEnvironmentParameterRepresentation(int index) const { |
386 return call_descriptor().GetEnvironmentParameterRepresentation(index); | 370 return call_descriptor().GetEnvironmentParameterRepresentation(index); |
387 } | 371 } |
388 | 372 |
389 ExternalReference miss_handler() const { | 373 ExternalReference miss_handler() const { |
390 DCHECK(has_miss_handler_); | 374 DCHECK(has_miss_handler_); |
391 return miss_handler_; | 375 return miss_handler_; |
392 } | 376 } |
393 | 377 |
394 bool has_miss_handler() const { | 378 bool has_miss_handler() const { |
(...skipping 10 matching lines...) Expand all Loading... | |
405 if (handler_arguments_mode_ == PASS_ARGUMENTS) { | 389 if (handler_arguments_mode_ == PASS_ARGUMENTS) { |
406 params += 1; | 390 params += 1; |
407 } | 391 } |
408 return params; | 392 return params; |
409 } | 393 } |
410 | 394 |
411 int hint_stack_parameter_count() const { return hint_stack_parameter_count_; } | 395 int hint_stack_parameter_count() const { return hint_stack_parameter_count_; } |
412 Register stack_parameter_count() const { return stack_parameter_count_; } | 396 Register stack_parameter_count() const { return stack_parameter_count_; } |
413 StubFunctionMode function_mode() const { return function_mode_; } | 397 StubFunctionMode function_mode() const { return function_mode_; } |
414 Address deoptimization_handler() const { return deoptimization_handler_; } | 398 Address deoptimization_handler() const { return deoptimization_handler_; } |
415 CodeStub::Major MajorKey() const { return major_; } | |
416 | 399 |
417 private: | 400 private: |
418 CallInterfaceDescriptor call_descriptor_; | 401 CallInterfaceDescriptor call_descriptor_; |
419 Register stack_parameter_count_; | 402 Register stack_parameter_count_; |
420 // If hint_stack_parameter_count_ > 0, the code stub can optimize the | 403 // If hint_stack_parameter_count_ > 0, the code stub can optimize the |
421 // return sequence. Default value is -1, which means it is ignored. | 404 // return sequence. Default value is -1, which means it is ignored. |
422 int hint_stack_parameter_count_; | 405 int hint_stack_parameter_count_; |
423 StubFunctionMode function_mode_; | 406 StubFunctionMode function_mode_; |
424 | 407 |
425 Address deoptimization_handler_; | 408 Address deoptimization_handler_; |
426 HandlerArgumentsMode handler_arguments_mode_; | 409 HandlerArgumentsMode handler_arguments_mode_; |
427 | 410 |
428 ExternalReference miss_handler_; | 411 ExternalReference miss_handler_; |
429 bool has_miss_handler_; | 412 bool has_miss_handler_; |
430 CodeStub::Major major_; | |
431 }; | 413 }; |
432 | 414 |
433 | 415 |
434 class HydrogenCodeStub : public CodeStub { | 416 class HydrogenCodeStub : public CodeStub { |
435 public: | 417 public: |
436 enum InitializationState { | 418 enum InitializationState { |
437 UNINITIALIZED, | 419 UNINITIALIZED, |
438 INITIALIZED | 420 INITIALIZED |
439 }; | 421 }; |
440 | 422 |
441 virtual Code::Kind GetCodeKind() const { return Code::STUB; } | 423 virtual Code::Kind GetCodeKind() const { return Code::STUB; } |
442 | 424 |
443 template<class SubClass> | 425 template<class SubClass> |
444 static Handle<Code> GetUninitialized(Isolate* isolate) { | 426 static Handle<Code> GetUninitialized(Isolate* isolate) { |
445 SubClass::GenerateAheadOfTime(isolate); | 427 SubClass::GenerateAheadOfTime(isolate); |
446 return SubClass().GetCode(isolate); | 428 return SubClass().GetCode(isolate); |
447 } | 429 } |
448 | 430 |
449 // Retrieve the code for the stub. Generate the code if needed. | 431 // Retrieve the code for the stub. Generate the code if needed. |
450 virtual Handle<Code> GenerateCode() = 0; | 432 virtual Handle<Code> GenerateCode() = 0; |
451 | 433 |
452 bool IsUninitialized() const { return IsMissBits::decode(minor_key_); } | 434 bool IsUninitialized() const { return IsMissBits::decode(minor_key_); } |
453 | 435 |
454 Handle<Code> GenerateLightweightMissCode(); | 436 Handle<Code> GenerateLightweightMissCode(ExternalReference miss); |
455 | 437 |
456 template<class StateType> | 438 template<class StateType> |
457 void TraceTransition(StateType from, StateType to); | 439 void TraceTransition(StateType from, StateType to); |
458 | 440 |
459 protected: | 441 protected: |
460 explicit HydrogenCodeStub(Isolate* isolate, | 442 explicit HydrogenCodeStub(Isolate* isolate, |
461 InitializationState state = INITIALIZED) | 443 InitializationState state = INITIALIZED) |
462 : CodeStub(isolate) { | 444 : CodeStub(isolate) { |
463 minor_key_ = IsMissBits::encode(state == UNINITIALIZED); | 445 minor_key_ = IsMissBits::encode(state == UNINITIALIZED); |
464 } | 446 } |
465 | 447 |
466 void set_sub_minor_key(uint32_t key) { | 448 void set_sub_minor_key(uint32_t key) { |
467 minor_key_ = SubMinorKeyBits::update(minor_key_, key); | 449 minor_key_ = SubMinorKeyBits::update(minor_key_, key); |
468 } | 450 } |
469 | 451 |
470 uint32_t sub_minor_key() const { return SubMinorKeyBits::decode(minor_key_); } | 452 uint32_t sub_minor_key() const { return SubMinorKeyBits::decode(minor_key_); } |
471 | 453 |
472 static const int kSubMinorKeyBits = kStubMinorKeyBits - 1; | 454 static const int kSubMinorKeyBits = kStubMinorKeyBits - 1; |
473 | 455 |
474 private: | 456 private: |
475 class IsMissBits : public BitField<bool, kSubMinorKeyBits, 1> {}; | 457 class IsMissBits : public BitField<bool, kSubMinorKeyBits, 1> {}; |
476 class SubMinorKeyBits : public BitField<int, 0, kSubMinorKeyBits> {}; | 458 class SubMinorKeyBits : public BitField<int, 0, kSubMinorKeyBits> {}; |
477 | 459 |
478 void GenerateLightweightMiss(MacroAssembler* masm); | 460 void GenerateLightweightMiss(MacroAssembler* masm, ExternalReference miss); |
479 | 461 |
480 DEFINE_CODE_STUB_BASE(HydrogenCodeStub, CodeStub); | 462 DEFINE_CODE_STUB_BASE(HydrogenCodeStub, CodeStub); |
481 }; | 463 }; |
482 | 464 |
483 | 465 |
484 // Helper interface to prepare to/restore after making runtime calls. | 466 // Helper interface to prepare to/restore after making runtime calls. |
485 class RuntimeCallHelper { | 467 class RuntimeCallHelper { |
486 public: | 468 public: |
487 virtual ~RuntimeCallHelper() {} | 469 virtual ~RuntimeCallHelper() {} |
488 | 470 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
542 virtual void BeforeCall(MacroAssembler* masm) const {} | 524 virtual void BeforeCall(MacroAssembler* masm) const {} |
543 | 525 |
544 virtual void AfterCall(MacroAssembler* masm) const {} | 526 virtual void AfterCall(MacroAssembler* masm) const {} |
545 }; | 527 }; |
546 | 528 |
547 | 529 |
548 class ToNumberStub: public HydrogenCodeStub { | 530 class ToNumberStub: public HydrogenCodeStub { |
549 public: | 531 public: |
550 explicit ToNumberStub(Isolate* isolate) : HydrogenCodeStub(isolate) { } | 532 explicit ToNumberStub(Isolate* isolate) : HydrogenCodeStub(isolate) { } |
551 | 533 |
534 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToNumber); | |
552 DEFINE_HYDROGEN_CODE_STUB(ToNumber, HydrogenCodeStub); | 535 DEFINE_HYDROGEN_CODE_STUB(ToNumber, HydrogenCodeStub); |
553 }; | 536 }; |
554 | 537 |
555 | 538 |
556 class NumberToStringStub FINAL : public HydrogenCodeStub { | 539 class NumberToStringStub FINAL : public HydrogenCodeStub { |
557 public: | 540 public: |
558 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 541 explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
559 | 542 |
560 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 543 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
561 static const int kNumber = 0; | 544 static const int kNumber = 0; |
562 | 545 |
546 DEFINE_CALL_INTERFACE_DESCRIPTOR(NumberToString); | |
563 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); | 547 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); |
564 }; | 548 }; |
565 | 549 |
566 | 550 |
567 class FastNewClosureStub : public HydrogenCodeStub { | 551 class FastNewClosureStub : public HydrogenCodeStub { |
568 public: | 552 public: |
569 FastNewClosureStub(Isolate* isolate, StrictMode strict_mode, | 553 FastNewClosureStub(Isolate* isolate, StrictMode strict_mode, |
570 bool is_generator) | 554 bool is_generator) |
571 : HydrogenCodeStub(isolate) { | 555 : HydrogenCodeStub(isolate) { |
572 set_sub_minor_key(StrictModeBits::encode(strict_mode) | | 556 set_sub_minor_key(StrictModeBits::encode(strict_mode) | |
573 IsGeneratorBits::encode(is_generator)); | 557 IsGeneratorBits::encode(is_generator)); |
574 } | 558 } |
575 | 559 |
576 StrictMode strict_mode() const { | 560 StrictMode strict_mode() const { |
577 return StrictModeBits::decode(sub_minor_key()); | 561 return StrictModeBits::decode(sub_minor_key()); |
578 } | 562 } |
579 | 563 |
580 bool is_generator() const { return IsGeneratorBits::decode(sub_minor_key()); } | 564 bool is_generator() const { return IsGeneratorBits::decode(sub_minor_key()); } |
581 | 565 |
582 private: | 566 private: |
583 class StrictModeBits : public BitField<StrictMode, 0, 1> {}; | 567 class StrictModeBits : public BitField<StrictMode, 0, 1> {}; |
584 class IsGeneratorBits : public BitField<bool, 1, 1> {}; | 568 class IsGeneratorBits : public BitField<bool, 1, 1> {}; |
585 | 569 |
570 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); | |
586 DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub); | 571 DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub); |
587 }; | 572 }; |
588 | 573 |
589 | 574 |
590 class FastNewContextStub FINAL : public HydrogenCodeStub { | 575 class FastNewContextStub FINAL : public HydrogenCodeStub { |
591 public: | 576 public: |
592 static const int kMaximumSlots = 64; | 577 static const int kMaximumSlots = 64; |
593 | 578 |
594 FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) { | 579 FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) { |
595 DCHECK(slots > 0 && slots <= kMaximumSlots); | 580 DCHECK(slots > 0 && slots <= kMaximumSlots); |
596 set_sub_minor_key(SlotsBits::encode(slots)); | 581 set_sub_minor_key(SlotsBits::encode(slots)); |
597 } | 582 } |
598 | 583 |
599 int slots() const { return SlotsBits::decode(sub_minor_key()); } | 584 int slots() const { return SlotsBits::decode(sub_minor_key()); } |
600 | 585 |
601 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 586 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
602 static const int kFunction = 0; | 587 static const int kFunction = 0; |
603 | 588 |
604 private: | 589 private: |
605 class SlotsBits : public BitField<int, 0, 8> {}; | 590 class SlotsBits : public BitField<int, 0, 8> {}; |
606 | 591 |
592 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewContext); | |
607 DEFINE_HYDROGEN_CODE_STUB(FastNewContext, HydrogenCodeStub); | 593 DEFINE_HYDROGEN_CODE_STUB(FastNewContext, HydrogenCodeStub); |
608 }; | 594 }; |
609 | 595 |
610 | 596 |
611 class FastCloneShallowArrayStub : public HydrogenCodeStub { | 597 class FastCloneShallowArrayStub : public HydrogenCodeStub { |
612 public: | 598 public: |
613 FastCloneShallowArrayStub(Isolate* isolate, | 599 FastCloneShallowArrayStub(Isolate* isolate, |
614 AllocationSiteMode allocation_site_mode) | 600 AllocationSiteMode allocation_site_mode) |
615 : HydrogenCodeStub(isolate) { | 601 : HydrogenCodeStub(isolate) { |
616 set_sub_minor_key(AllocationSiteModeBits::encode(allocation_site_mode)); | 602 set_sub_minor_key(AllocationSiteModeBits::encode(allocation_site_mode)); |
617 } | 603 } |
618 | 604 |
619 AllocationSiteMode allocation_site_mode() const { | 605 AllocationSiteMode allocation_site_mode() const { |
620 return AllocationSiteModeBits::decode(sub_minor_key()); | 606 return AllocationSiteModeBits::decode(sub_minor_key()); |
621 } | 607 } |
622 | 608 |
623 private: | 609 private: |
624 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; | 610 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
625 | 611 |
612 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowArray); | |
626 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowArray, HydrogenCodeStub); | 613 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowArray, HydrogenCodeStub); |
627 }; | 614 }; |
628 | 615 |
629 | 616 |
630 class FastCloneShallowObjectStub : public HydrogenCodeStub { | 617 class FastCloneShallowObjectStub : public HydrogenCodeStub { |
631 public: | 618 public: |
632 // Maximum number of properties in copied object. | 619 // Maximum number of properties in copied object. |
633 static const int kMaximumClonedProperties = 6; | 620 static const int kMaximumClonedProperties = 6; |
634 | 621 |
635 FastCloneShallowObjectStub(Isolate* isolate, int length) | 622 FastCloneShallowObjectStub(Isolate* isolate, int length) |
636 : HydrogenCodeStub(isolate) { | 623 : HydrogenCodeStub(isolate) { |
637 DCHECK_GE(length, 0); | 624 DCHECK_GE(length, 0); |
638 DCHECK_LE(length, kMaximumClonedProperties); | 625 DCHECK_LE(length, kMaximumClonedProperties); |
639 set_sub_minor_key(LengthBits::encode(length)); | 626 set_sub_minor_key(LengthBits::encode(length)); |
640 } | 627 } |
641 | 628 |
642 int length() const { return LengthBits::decode(sub_minor_key()); } | 629 int length() const { return LengthBits::decode(sub_minor_key()); } |
643 | 630 |
644 private: | 631 private: |
645 class LengthBits : public BitField<int, 0, 4> {}; | 632 class LengthBits : public BitField<int, 0, 4> {}; |
646 | 633 |
634 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastCloneShallowObject); | |
647 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowObject, HydrogenCodeStub); | 635 DEFINE_HYDROGEN_CODE_STUB(FastCloneShallowObject, HydrogenCodeStub); |
648 }; | 636 }; |
649 | 637 |
650 | 638 |
651 class CreateAllocationSiteStub : public HydrogenCodeStub { | 639 class CreateAllocationSiteStub : public HydrogenCodeStub { |
652 public: | 640 public: |
653 explicit CreateAllocationSiteStub(Isolate* isolate) | 641 explicit CreateAllocationSiteStub(Isolate* isolate) |
654 : HydrogenCodeStub(isolate) { } | 642 : HydrogenCodeStub(isolate) { } |
655 | 643 |
656 static void GenerateAheadOfTime(Isolate* isolate); | 644 static void GenerateAheadOfTime(Isolate* isolate); |
657 | 645 |
646 DEFINE_CALL_INTERFACE_DESCRIPTOR(CreateAllocationSite); | |
658 DEFINE_HYDROGEN_CODE_STUB(CreateAllocationSite, HydrogenCodeStub); | 647 DEFINE_HYDROGEN_CODE_STUB(CreateAllocationSite, HydrogenCodeStub); |
659 }; | 648 }; |
660 | 649 |
661 | 650 |
662 class InstanceofStub: public PlatformCodeStub { | 651 class InstanceofStub: public PlatformCodeStub { |
663 public: | 652 public: |
664 enum Flags { | 653 enum Flags { |
665 kNoFlags = 0, | 654 kNoFlags = 0, |
666 kArgsInRegisters = 1 << 0, | 655 kArgsInRegisters = 1 << 0, |
667 kCallSiteInlineCheck = 1 << 1, | 656 kCallSiteInlineCheck = 1 << 1, |
668 kReturnTrueFalseObject = 1 << 2 | 657 kReturnTrueFalseObject = 1 << 2 |
669 }; | 658 }; |
670 | 659 |
671 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { | 660 InstanceofStub(Isolate* isolate, Flags flags) : PlatformCodeStub(isolate) { |
672 minor_key_ = FlagBits::encode(flags); | 661 minor_key_ = FlagBits::encode(flags); |
673 } | 662 } |
674 | 663 |
675 static Register left() { return InstanceofDescriptor::left(); } | 664 static Register left() { return InstanceofDescriptor::left(); } |
676 static Register right() { return InstanceofDescriptor::right(); } | 665 static Register right() { return InstanceofDescriptor::right(); } |
677 | 666 |
678 virtual void InitializeInterfaceDescriptor( | |
679 CodeStubInterfaceDescriptor* descriptor); | |
680 | |
681 private: | 667 private: |
682 Flags flags() const { return FlagBits::decode(minor_key_); } | 668 Flags flags() const { return FlagBits::decode(minor_key_); } |
683 | 669 |
684 bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; } | 670 bool HasArgsInRegisters() const { return (flags() & kArgsInRegisters) != 0; } |
685 | 671 |
686 bool HasCallSiteInlineCheck() const { | 672 bool HasCallSiteInlineCheck() const { |
687 return (flags() & kCallSiteInlineCheck) != 0; | 673 return (flags() & kCallSiteInlineCheck) != 0; |
688 } | 674 } |
689 | 675 |
690 bool ReturnTrueFalseObject() const { | 676 bool ReturnTrueFalseObject() const { |
691 return (flags() & kReturnTrueFalseObject) != 0; | 677 return (flags() & kReturnTrueFalseObject) != 0; |
692 } | 678 } |
693 | 679 |
694 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT | 680 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT |
695 | 681 |
696 class FlagBits : public BitField<Flags, 0, 3> {}; | 682 class FlagBits : public BitField<Flags, 0, 3> {}; |
697 | 683 |
684 DEFINE_CALL_INTERFACE_DESCRIPTOR(Instanceof); | |
698 DEFINE_PLATFORM_CODE_STUB(Instanceof, PlatformCodeStub); | 685 DEFINE_PLATFORM_CODE_STUB(Instanceof, PlatformCodeStub); |
699 }; | 686 }; |
700 | 687 |
701 | 688 |
702 enum AllocationSiteOverrideMode { | 689 enum AllocationSiteOverrideMode { |
703 DONT_OVERRIDE, | 690 DONT_OVERRIDE, |
704 DISABLE_ALLOCATION_SITES, | 691 DISABLE_ALLOCATION_SITES, |
705 LAST_ALLOCATION_SITE_OVERRIDE_MODE = DISABLE_ALLOCATION_SITES | 692 LAST_ALLOCATION_SITE_OVERRIDE_MODE = DISABLE_ALLOCATION_SITES |
706 }; | 693 }; |
707 | 694 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
827 DEFINE_PLATFORM_CODE_STUB(FunctionPrototype, PlatformCodeStub); | 814 DEFINE_PLATFORM_CODE_STUB(FunctionPrototype, PlatformCodeStub); |
828 }; | 815 }; |
829 | 816 |
830 | 817 |
831 class HandlerStub : public HydrogenCodeStub { | 818 class HandlerStub : public HydrogenCodeStub { |
832 public: | 819 public: |
833 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } | 820 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } |
834 virtual ExtraICState GetExtraICState() const { return kind(); } | 821 virtual ExtraICState GetExtraICState() const { return kind(); } |
835 virtual InlineCacheState GetICState() const { return MONOMORPHIC; } | 822 virtual InlineCacheState GetICState() const { return MONOMORPHIC; } |
836 | 823 |
837 virtual void InitializeInterfaceDescriptor( | 824 virtual void InitializeDescriptor(CodeStubDescriptor* descriptor) OVERRIDE; |
838 CodeStubInterfaceDescriptor* descriptor) OVERRIDE; | 825 |
826 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE; | |
839 | 827 |
840 protected: | 828 protected: |
841 explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 829 explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
842 | 830 |
843 virtual Code::Kind kind() const = 0; | 831 virtual Code::Kind kind() const = 0; |
844 | 832 |
845 DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub); | 833 DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub); |
846 }; | 834 }; |
847 | 835 |
848 | 836 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1062 virtual void PrintState(OStream& os) const FINAL OVERRIDE; // NOLINT | 1050 virtual void PrintState(OStream& os) const FINAL OVERRIDE; // NOLINT |
1063 | 1051 |
1064 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1052 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1065 static const int kLeft = 0; | 1053 static const int kLeft = 0; |
1066 static const int kRight = 1; | 1054 static const int kRight = 1; |
1067 | 1055 |
1068 private: | 1056 private: |
1069 static void GenerateAheadOfTime(Isolate* isolate, | 1057 static void GenerateAheadOfTime(Isolate* isolate, |
1070 const BinaryOpIC::State& state); | 1058 const BinaryOpIC::State& state); |
1071 | 1059 |
1060 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | |
1072 DEFINE_HYDROGEN_CODE_STUB(BinaryOpIC, HydrogenCodeStub); | 1061 DEFINE_HYDROGEN_CODE_STUB(BinaryOpIC, HydrogenCodeStub); |
1073 }; | 1062 }; |
1074 | 1063 |
1075 | 1064 |
1076 // TODO(bmeurer): Merge this into the BinaryOpICStub once we have proper tail | 1065 // TODO(bmeurer): Merge this into the BinaryOpICStub once we have proper tail |
1077 // call support for stubs in Hydrogen. | 1066 // call support for stubs in Hydrogen. |
1078 class BinaryOpICWithAllocationSiteStub FINAL : public PlatformCodeStub { | 1067 class BinaryOpICWithAllocationSiteStub FINAL : public PlatformCodeStub { |
1079 public: | 1068 public: |
1080 BinaryOpICWithAllocationSiteStub(Isolate* isolate, | 1069 BinaryOpICWithAllocationSiteStub(Isolate* isolate, |
1081 const BinaryOpIC::State& state) | 1070 const BinaryOpIC::State& state) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1130 | 1119 |
1131 virtual Code::Kind GetCodeKind() const FINAL OVERRIDE { | 1120 virtual Code::Kind GetCodeKind() const FINAL OVERRIDE { |
1132 return Code::STUB; | 1121 return Code::STUB; |
1133 } | 1122 } |
1134 | 1123 |
1135 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1124 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1136 static const int kAllocationSite = 0; | 1125 static const int kAllocationSite = 0; |
1137 static const int kLeft = 1; | 1126 static const int kLeft = 1; |
1138 static const int kRight = 2; | 1127 static const int kRight = 2; |
1139 | 1128 |
1129 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOpWithAllocationSite); | |
1140 DEFINE_HYDROGEN_CODE_STUB(BinaryOpWithAllocationSite, BinaryOpICStub); | 1130 DEFINE_HYDROGEN_CODE_STUB(BinaryOpWithAllocationSite, BinaryOpICStub); |
1141 }; | 1131 }; |
1142 | 1132 |
1143 | 1133 |
1144 enum StringAddFlags { | 1134 enum StringAddFlags { |
1145 // Omit both parameter checks. | 1135 // Omit both parameter checks. |
1146 STRING_ADD_CHECK_NONE = 0, | 1136 STRING_ADD_CHECK_NONE = 0, |
1147 // Check left parameter. | 1137 // Check left parameter. |
1148 STRING_ADD_CHECK_LEFT = 1 << 0, | 1138 STRING_ADD_CHECK_LEFT = 1 << 0, |
1149 // Check right parameter. | 1139 // Check right parameter. |
(...skipping 23 matching lines...) Expand all Loading... | |
1173 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1163 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1174 static const int kLeft = 0; | 1164 static const int kLeft = 0; |
1175 static const int kRight = 1; | 1165 static const int kRight = 1; |
1176 | 1166 |
1177 private: | 1167 private: |
1178 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; | 1168 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; |
1179 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; | 1169 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; |
1180 | 1170 |
1181 virtual void PrintBaseName(OStream& os) const OVERRIDE; // NOLINT | 1171 virtual void PrintBaseName(OStream& os) const OVERRIDE; // NOLINT |
1182 | 1172 |
1173 DEFINE_CALL_INTERFACE_DESCRIPTOR(StringAdd); | |
1183 DEFINE_HYDROGEN_CODE_STUB(StringAdd, HydrogenCodeStub); | 1174 DEFINE_HYDROGEN_CODE_STUB(StringAdd, HydrogenCodeStub); |
1184 }; | 1175 }; |
1185 | 1176 |
1186 | 1177 |
1187 class CompareICStub : public PlatformCodeStub { | 1178 class CompareICStub : public PlatformCodeStub { |
1188 public: | 1179 public: |
1189 CompareICStub(Isolate* isolate, Token::Value op, CompareIC::State left, | 1180 CompareICStub(Isolate* isolate, Token::Value op, CompareIC::State left, |
1190 CompareIC::State right, CompareIC::State state) | 1181 CompareIC::State right, CompareIC::State state) |
1191 : PlatformCodeStub(isolate) { | 1182 : PlatformCodeStub(isolate) { |
1192 DCHECK(Token::IsCompareOp(op)); | 1183 DCHECK(Token::IsCompareOp(op)); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1312 }; | 1303 }; |
1313 friend OStream& operator<<(OStream& os, const State& s); | 1304 friend OStream& operator<<(OStream& os, const State& s); |
1314 | 1305 |
1315 State state() const { return State(TypesBits::decode(sub_minor_key())); } | 1306 State state() const { return State(TypesBits::decode(sub_minor_key())); } |
1316 | 1307 |
1317 class NilValueBits : public BitField<NilValue, 0, 1> {}; | 1308 class NilValueBits : public BitField<NilValue, 0, 1> {}; |
1318 class TypesBits : public BitField<byte, 1, NUMBER_OF_TYPES> {}; | 1309 class TypesBits : public BitField<byte, 1, NUMBER_OF_TYPES> {}; |
1319 | 1310 |
1320 friend class CompareNilIC; | 1311 friend class CompareNilIC; |
1321 | 1312 |
1313 DEFINE_CALL_INTERFACE_DESCRIPTOR(CompareNil); | |
1322 DEFINE_HYDROGEN_CODE_STUB(CompareNilIC, HydrogenCodeStub); | 1314 DEFINE_HYDROGEN_CODE_STUB(CompareNilIC, HydrogenCodeStub); |
1323 }; | 1315 }; |
1324 | 1316 |
1325 | 1317 |
1326 OStream& operator<<(OStream& os, const CompareNilICStub::State& s); | 1318 OStream& operator<<(OStream& os, const CompareNilICStub::State& s); |
1327 | 1319 |
1328 | 1320 |
1329 class CEntryStub : public PlatformCodeStub { | 1321 class CEntryStub : public PlatformCodeStub { |
1330 public: | 1322 public: |
1331 CEntryStub(Isolate* isolate, int result_size, | 1323 CEntryStub(Isolate* isolate, int result_size, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1427 class RegExpConstructResultStub FINAL : public HydrogenCodeStub { | 1419 class RegExpConstructResultStub FINAL : public HydrogenCodeStub { |
1428 public: | 1420 public: |
1429 explicit RegExpConstructResultStub(Isolate* isolate) | 1421 explicit RegExpConstructResultStub(Isolate* isolate) |
1430 : HydrogenCodeStub(isolate) { } | 1422 : HydrogenCodeStub(isolate) { } |
1431 | 1423 |
1432 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1424 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1433 static const int kLength = 0; | 1425 static const int kLength = 0; |
1434 static const int kIndex = 1; | 1426 static const int kIndex = 1; |
1435 static const int kInput = 2; | 1427 static const int kInput = 2; |
1436 | 1428 |
1429 DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpConstructResult); | |
1437 DEFINE_HYDROGEN_CODE_STUB(RegExpConstructResult, HydrogenCodeStub); | 1430 DEFINE_HYDROGEN_CODE_STUB(RegExpConstructResult, HydrogenCodeStub); |
1438 }; | 1431 }; |
1439 | 1432 |
1440 | 1433 |
1441 class CallFunctionStub: public PlatformCodeStub { | 1434 class CallFunctionStub: public PlatformCodeStub { |
1442 public: | 1435 public: |
1443 CallFunctionStub(Isolate* isolate, int argc, CallFunctionFlags flags) | 1436 CallFunctionStub(Isolate* isolate, int argc, CallFunctionFlags flags) |
1444 : PlatformCodeStub(isolate) { | 1437 : PlatformCodeStub(isolate) { |
1445 DCHECK(argc >= 0 && argc <= Code::kMaxArguments); | 1438 DCHECK(argc >= 0 && argc <= Code::kMaxArguments); |
1446 minor_key_ = ArgcBits::encode(argc) | FlagBits::encode(flags); | 1439 minor_key_ = ArgcBits::encode(argc) | FlagBits::encode(flags); |
1447 } | 1440 } |
1448 | 1441 |
1449 virtual void InitializeInterfaceDescriptor( | |
1450 CodeStubInterfaceDescriptor* descriptor); | |
1451 | |
1452 static int ExtractArgcFromMinorKey(int minor_key) { | 1442 static int ExtractArgcFromMinorKey(int minor_key) { |
1453 return ArgcBits::decode(minor_key); | 1443 return ArgcBits::decode(minor_key); |
1454 } | 1444 } |
1455 | 1445 |
1456 private: | 1446 private: |
1457 int argc() const { return ArgcBits::decode(minor_key_); } | 1447 int argc() const { return ArgcBits::decode(minor_key_); } |
1458 int flags() const { return FlagBits::decode(minor_key_); } | 1448 int flags() const { return FlagBits::decode(minor_key_); } |
1459 | 1449 |
1460 bool CallAsMethod() const { | 1450 bool CallAsMethod() const { |
1461 return flags() == CALL_AS_METHOD || flags() == WRAP_AND_CALL; | 1451 return flags() == CALL_AS_METHOD || flags() == WRAP_AND_CALL; |
1462 } | 1452 } |
1463 | 1453 |
1464 bool NeedsChecks() const { return flags() != WRAP_AND_CALL; } | 1454 bool NeedsChecks() const { return flags() != WRAP_AND_CALL; } |
1465 | 1455 |
1466 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT | 1456 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT |
1467 | 1457 |
1468 // Minor key encoding in 32 bits with Bitfield <Type, shift, size>. | 1458 // Minor key encoding in 32 bits with Bitfield <Type, shift, size>. |
1469 class FlagBits : public BitField<CallFunctionFlags, 0, 2> {}; | 1459 class FlagBits : public BitField<CallFunctionFlags, 0, 2> {}; |
1470 class ArgcBits : public BitField<unsigned, 2, Code::kArgumentsBits> {}; | 1460 class ArgcBits : public BitField<unsigned, 2, Code::kArgumentsBits> {}; |
1471 STATIC_ASSERT(Code::kArgumentsBits + 2 <= kStubMinorKeyBits); | 1461 STATIC_ASSERT(Code::kArgumentsBits + 2 <= kStubMinorKeyBits); |
1472 | 1462 |
1463 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunction); | |
1473 DEFINE_PLATFORM_CODE_STUB(CallFunction, PlatformCodeStub); | 1464 DEFINE_PLATFORM_CODE_STUB(CallFunction, PlatformCodeStub); |
1474 }; | 1465 }; |
1475 | 1466 |
1476 | 1467 |
1477 class CallConstructStub: public PlatformCodeStub { | 1468 class CallConstructStub: public PlatformCodeStub { |
1478 public: | 1469 public: |
1479 CallConstructStub(Isolate* isolate, CallConstructorFlags flags) | 1470 CallConstructStub(Isolate* isolate, CallConstructorFlags flags) |
1480 : PlatformCodeStub(isolate) { | 1471 : PlatformCodeStub(isolate) { |
1481 minor_key_ = FlagBits::encode(flags); | 1472 minor_key_ = FlagBits::encode(flags); |
1482 } | 1473 } |
1483 | 1474 |
1484 virtual void InitializeInterfaceDescriptor( | |
1485 CodeStubInterfaceDescriptor* descriptor); | |
1486 | |
1487 virtual void FinishCode(Handle<Code> code) { | 1475 virtual void FinishCode(Handle<Code> code) { |
1488 code->set_has_function_cache(RecordCallTarget()); | 1476 code->set_has_function_cache(RecordCallTarget()); |
1489 } | 1477 } |
1490 | 1478 |
1491 private: | 1479 private: |
1492 CallConstructorFlags flags() const { return FlagBits::decode(minor_key_); } | 1480 CallConstructorFlags flags() const { return FlagBits::decode(minor_key_); } |
1493 | 1481 |
1494 bool RecordCallTarget() const { | 1482 bool RecordCallTarget() const { |
1495 return (flags() & RECORD_CONSTRUCTOR_TARGET) != 0; | 1483 return (flags() & RECORD_CONSTRUCTOR_TARGET) != 0; |
1496 } | 1484 } |
1497 | 1485 |
1498 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT | 1486 virtual void PrintName(OStream& os) const OVERRIDE; // NOLINT |
1499 | 1487 |
1500 class FlagBits : public BitField<CallConstructorFlags, 0, 1> {}; | 1488 class FlagBits : public BitField<CallConstructorFlags, 0, 1> {}; |
1501 | 1489 |
1490 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallConstruct); | |
1502 DEFINE_PLATFORM_CODE_STUB(CallConstruct, PlatformCodeStub); | 1491 DEFINE_PLATFORM_CODE_STUB(CallConstruct, PlatformCodeStub); |
1503 }; | 1492 }; |
1504 | 1493 |
1505 | 1494 |
1506 enum StringIndexFlags { | 1495 enum StringIndexFlags { |
1507 // Accepts smis or heap numbers. | 1496 // Accepts smis or heap numbers. |
1508 STRING_INDEX_IS_NUMBER, | 1497 STRING_INDEX_IS_NUMBER, |
1509 | 1498 |
1510 // Accepts smis or heap numbers that are valid array indices | 1499 // Accepts smis or heap numbers that are valid array indices |
1511 // (ECMA-262 15.4). Invalid indices are reported as being out of | 1500 // (ECMA-262 15.4). Invalid indices are reported as being out of |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1675 | 1664 |
1676 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 1665 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
1677 }; | 1666 }; |
1678 | 1667 |
1679 | 1668 |
1680 class LoadDictionaryElementStub : public HydrogenCodeStub { | 1669 class LoadDictionaryElementStub : public HydrogenCodeStub { |
1681 public: | 1670 public: |
1682 explicit LoadDictionaryElementStub(Isolate* isolate) | 1671 explicit LoadDictionaryElementStub(Isolate* isolate) |
1683 : HydrogenCodeStub(isolate) {} | 1672 : HydrogenCodeStub(isolate) {} |
1684 | 1673 |
1674 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | |
1685 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); | 1675 DEFINE_HYDROGEN_CODE_STUB(LoadDictionaryElement, HydrogenCodeStub); |
1686 }; | 1676 }; |
1687 | 1677 |
1688 | 1678 |
1689 class KeyedLoadGenericStub : public HydrogenCodeStub { | 1679 class KeyedLoadGenericStub : public HydrogenCodeStub { |
1690 public: | 1680 public: |
1691 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} | 1681 explicit KeyedLoadGenericStub(Isolate* isolate) : HydrogenCodeStub(isolate) {} |
1692 | 1682 |
1693 virtual Code::Kind GetCodeKind() const { return Code::KEYED_LOAD_IC; } | 1683 virtual Code::Kind GetCodeKind() const { return Code::KEYED_LOAD_IC; } |
1694 virtual InlineCacheState GetICState() const { return GENERIC; } | 1684 virtual InlineCacheState GetICState() const { return GENERIC; } |
1695 | 1685 |
1686 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | |
1696 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); | 1687 DEFINE_HYDROGEN_CODE_STUB(KeyedLoadGeneric, HydrogenCodeStub); |
1697 }; | 1688 }; |
1698 | 1689 |
1699 | 1690 |
1700 class LoadICTrampolineStub : public PlatformCodeStub { | 1691 class LoadICTrampolineStub : public PlatformCodeStub { |
1701 public: | 1692 public: |
1702 LoadICTrampolineStub(Isolate* isolate, const LoadIC::State& state) | 1693 LoadICTrampolineStub(Isolate* isolate, const LoadIC::State& state) |
1703 : PlatformCodeStub(isolate) { | 1694 : PlatformCodeStub(isolate) { |
1704 minor_key_ = state.GetExtraICState(); | 1695 minor_key_ = state.GetExtraICState(); |
1705 } | 1696 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1746 virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } | 1737 virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } |
1747 | 1738 |
1748 virtual InlineCacheState GetICState() const FINAL OVERRIDE { | 1739 virtual InlineCacheState GetICState() const FINAL OVERRIDE { |
1749 return MEGAMORPHIC; | 1740 return MEGAMORPHIC; |
1750 } | 1741 } |
1751 | 1742 |
1752 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { | 1743 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { |
1753 return static_cast<ExtraICState>(sub_minor_key()); | 1744 return static_cast<ExtraICState>(sub_minor_key()); |
1754 } | 1745 } |
1755 | 1746 |
1747 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | |
1756 DEFINE_HYDROGEN_CODE_STUB(MegamorphicLoad, HydrogenCodeStub); | 1748 DEFINE_HYDROGEN_CODE_STUB(MegamorphicLoad, HydrogenCodeStub); |
1757 }; | 1749 }; |
1758 | 1750 |
1759 | 1751 |
1760 class VectorLoadStub : public HydrogenCodeStub { | 1752 class VectorLoadStub : public HydrogenCodeStub { |
1761 public: | 1753 public: |
1762 explicit VectorLoadStub(Isolate* isolate, const LoadIC::State& state) | 1754 explicit VectorLoadStub(Isolate* isolate, const LoadIC::State& state) |
1763 : HydrogenCodeStub(isolate) { | 1755 : HydrogenCodeStub(isolate) { |
1764 set_sub_minor_key(state.GetExtraICState()); | 1756 set_sub_minor_key(state.GetExtraICState()); |
1765 } | 1757 } |
1766 | 1758 |
1767 virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } | 1759 virtual Code::Kind GetCodeKind() const OVERRIDE { return Code::LOAD_IC; } |
1768 | 1760 |
1769 virtual InlineCacheState GetICState() const FINAL OVERRIDE { | 1761 virtual InlineCacheState GetICState() const FINAL OVERRIDE { |
1770 return GENERIC; | 1762 return GENERIC; |
1771 } | 1763 } |
1772 | 1764 |
1773 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { | 1765 virtual ExtraICState GetExtraICState() const FINAL OVERRIDE { |
1774 return static_cast<ExtraICState>(sub_minor_key()); | 1766 return static_cast<ExtraICState>(sub_minor_key()); |
1775 } | 1767 } |
1776 | 1768 |
1777 private: | 1769 private: |
1778 LoadIC::State state() const { return LoadIC::State(GetExtraICState()); } | 1770 LoadIC::State state() const { return LoadIC::State(GetExtraICState()); } |
1779 | 1771 |
1772 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); | |
1780 DEFINE_HYDROGEN_CODE_STUB(VectorLoad, HydrogenCodeStub); | 1773 DEFINE_HYDROGEN_CODE_STUB(VectorLoad, HydrogenCodeStub); |
1781 }; | 1774 }; |
1782 | 1775 |
1783 | 1776 |
1784 class VectorKeyedLoadStub : public VectorLoadStub { | 1777 class VectorKeyedLoadStub : public VectorLoadStub { |
1785 public: | 1778 public: |
1786 explicit VectorKeyedLoadStub(Isolate* isolate) | 1779 explicit VectorKeyedLoadStub(Isolate* isolate) |
1787 : VectorLoadStub(isolate, LoadIC::State(0)) {} | 1780 : VectorLoadStub(isolate, LoadIC::State(0)) {} |
1788 | 1781 |
1789 virtual Code::Kind GetCodeKind() const OVERRIDE { | 1782 virtual Code::Kind GetCodeKind() const OVERRIDE { |
1790 return Code::KEYED_LOAD_IC; | 1783 return Code::KEYED_LOAD_IC; |
1791 } | 1784 } |
1792 | 1785 |
1786 DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorLoadIC); | |
1793 DEFINE_HYDROGEN_CODE_STUB(VectorKeyedLoad, VectorLoadStub); | 1787 DEFINE_HYDROGEN_CODE_STUB(VectorKeyedLoad, VectorLoadStub); |
1794 }; | 1788 }; |
1795 | 1789 |
1796 | 1790 |
1797 class DoubleToIStub : public PlatformCodeStub { | 1791 class DoubleToIStub : public PlatformCodeStub { |
1798 public: | 1792 public: |
1799 DoubleToIStub(Isolate* isolate, Register source, Register destination, | 1793 DoubleToIStub(Isolate* isolate, Register source, Register destination, |
1800 int offset, bool is_truncating, bool skip_fastpath = false) | 1794 int offset, bool is_truncating, bool skip_fastpath = false) |
1801 : PlatformCodeStub(isolate) { | 1795 : PlatformCodeStub(isolate) { |
1802 minor_key_ = SourceRegisterBits::encode(source.code()) | | 1796 minor_key_ = SourceRegisterBits::encode(source.code()) | |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1852 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 1846 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
1853 | 1847 |
1854 ElementsKind elements_kind() const { | 1848 ElementsKind elements_kind() const { |
1855 return ElementsKindBits::decode(sub_minor_key()); | 1849 return ElementsKindBits::decode(sub_minor_key()); |
1856 } | 1850 } |
1857 | 1851 |
1858 private: | 1852 private: |
1859 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 1853 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
1860 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 1854 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
1861 | 1855 |
1856 DEFINE_CALL_INTERFACE_DESCRIPTOR(Load); | |
1862 DEFINE_HYDROGEN_CODE_STUB(LoadFastElement, HydrogenCodeStub); | 1857 DEFINE_HYDROGEN_CODE_STUB(LoadFastElement, HydrogenCodeStub); |
1863 }; | 1858 }; |
1864 | 1859 |
1865 | 1860 |
1866 class StoreFastElementStub : public HydrogenCodeStub { | 1861 class StoreFastElementStub : public HydrogenCodeStub { |
1867 public: | 1862 public: |
1868 StoreFastElementStub(Isolate* isolate, bool is_js_array, | 1863 StoreFastElementStub(Isolate* isolate, bool is_js_array, |
1869 ElementsKind elements_kind, KeyedAccessStoreMode mode) | 1864 ElementsKind elements_kind, KeyedAccessStoreMode mode) |
1870 : HydrogenCodeStub(isolate) { | 1865 : HydrogenCodeStub(isolate) { |
1871 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | | 1866 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | |
1872 IsJSArrayBits::encode(is_js_array) | | 1867 IsJSArrayBits::encode(is_js_array) | |
1873 StoreModeBits::encode(mode)); | 1868 StoreModeBits::encode(mode)); |
1874 } | 1869 } |
1875 | 1870 |
1876 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 1871 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
1877 | 1872 |
1878 ElementsKind elements_kind() const { | 1873 ElementsKind elements_kind() const { |
1879 return ElementsKindBits::decode(sub_minor_key()); | 1874 return ElementsKindBits::decode(sub_minor_key()); |
1880 } | 1875 } |
1881 | 1876 |
1882 KeyedAccessStoreMode store_mode() const { | 1877 KeyedAccessStoreMode store_mode() const { |
1883 return StoreModeBits::decode(sub_minor_key()); | 1878 return StoreModeBits::decode(sub_minor_key()); |
1884 } | 1879 } |
1885 | 1880 |
1886 private: | 1881 private: |
1887 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 1882 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
1888 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; | 1883 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; |
1889 class IsJSArrayBits: public BitField<bool, 12, 1> {}; | 1884 class IsJSArrayBits: public BitField<bool, 12, 1> {}; |
1890 | 1885 |
1886 DEFINE_CALL_INTERFACE_DESCRIPTOR(Store); | |
1891 DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); | 1887 DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub); |
1892 }; | 1888 }; |
1893 | 1889 |
1894 | 1890 |
1895 class TransitionElementsKindStub : public HydrogenCodeStub { | 1891 class TransitionElementsKindStub : public HydrogenCodeStub { |
1896 public: | 1892 public: |
1897 TransitionElementsKindStub(Isolate* isolate, | 1893 TransitionElementsKindStub(Isolate* isolate, |
1898 ElementsKind from_kind, | 1894 ElementsKind from_kind, |
1899 ElementsKind to_kind, | 1895 ElementsKind to_kind, |
1900 bool is_js_array) : HydrogenCodeStub(isolate) { | 1896 bool is_js_array) : HydrogenCodeStub(isolate) { |
1901 set_sub_minor_key(FromKindBits::encode(from_kind) | | 1897 set_sub_minor_key(FromKindBits::encode(from_kind) | |
1902 ToKindBits::encode(to_kind) | | 1898 ToKindBits::encode(to_kind) | |
1903 IsJSArrayBits::encode(is_js_array)); | 1899 IsJSArrayBits::encode(is_js_array)); |
1904 } | 1900 } |
1905 | 1901 |
1906 ElementsKind from_kind() const { | 1902 ElementsKind from_kind() const { |
1907 return FromKindBits::decode(sub_minor_key()); | 1903 return FromKindBits::decode(sub_minor_key()); |
1908 } | 1904 } |
1909 | 1905 |
1910 ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); } | 1906 ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); } |
1911 | 1907 |
1912 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 1908 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
1913 | 1909 |
1914 private: | 1910 private: |
1915 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; | 1911 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; |
1916 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; | 1912 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; |
1917 class IsJSArrayBits: public BitField<bool, 16, 1> {}; | 1913 class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
1918 | 1914 |
1915 DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind); | |
1919 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); | 1916 DEFINE_HYDROGEN_CODE_STUB(TransitionElementsKind, HydrogenCodeStub); |
1920 }; | 1917 }; |
1921 | 1918 |
1922 | 1919 |
1923 class ArrayConstructorStubBase : public HydrogenCodeStub { | 1920 class ArrayConstructorStubBase : public HydrogenCodeStub { |
1924 public: | 1921 public: |
1925 ArrayConstructorStubBase(Isolate* isolate, | 1922 ArrayConstructorStubBase(Isolate* isolate, |
1926 ElementsKind kind, | 1923 ElementsKind kind, |
1927 AllocationSiteOverrideMode override_mode) | 1924 AllocationSiteOverrideMode override_mode) |
1928 : HydrogenCodeStub(isolate) { | 1925 : HydrogenCodeStub(isolate) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1971 ElementsKind kind, | 1968 ElementsKind kind, |
1972 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 1969 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
1973 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 1970 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
1974 } | 1971 } |
1975 | 1972 |
1976 private: | 1973 private: |
1977 virtual void PrintName(OStream& os) const OVERRIDE { // NOLINT | 1974 virtual void PrintName(OStream& os) const OVERRIDE { // NOLINT |
1978 BasePrintName(os, "ArrayNoArgumentConstructorStub"); | 1975 BasePrintName(os, "ArrayNoArgumentConstructorStub"); |
1979 } | 1976 } |
1980 | 1977 |
1978 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructorConstantArgCount); | |
1981 DEFINE_HYDROGEN_CODE_STUB(ArrayNoArgumentConstructor, | 1979 DEFINE_HYDROGEN_CODE_STUB(ArrayNoArgumentConstructor, |
1982 ArrayConstructorStubBase); | 1980 ArrayConstructorStubBase); |
1983 }; | 1981 }; |
1984 | 1982 |
1985 | 1983 |
1986 class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { | 1984 class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase { |
1987 public: | 1985 public: |
1988 ArraySingleArgumentConstructorStub( | 1986 ArraySingleArgumentConstructorStub( |
1989 Isolate* isolate, | 1987 Isolate* isolate, |
1990 ElementsKind kind, | 1988 ElementsKind kind, |
1991 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 1989 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
1992 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 1990 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
1993 } | 1991 } |
1994 | 1992 |
1995 private: | 1993 private: |
1996 virtual void PrintName(OStream& os) const { // NOLINT | 1994 virtual void PrintName(OStream& os) const { // NOLINT |
1997 BasePrintName(os, "ArraySingleArgumentConstructorStub"); | 1995 BasePrintName(os, "ArraySingleArgumentConstructorStub"); |
1998 } | 1996 } |
1999 | 1997 |
1998 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor); | |
2000 DEFINE_HYDROGEN_CODE_STUB(ArraySingleArgumentConstructor, | 1999 DEFINE_HYDROGEN_CODE_STUB(ArraySingleArgumentConstructor, |
2001 ArrayConstructorStubBase); | 2000 ArrayConstructorStubBase); |
2002 }; | 2001 }; |
2003 | 2002 |
2004 | 2003 |
2005 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { | 2004 class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase { |
2006 public: | 2005 public: |
2007 ArrayNArgumentsConstructorStub( | 2006 ArrayNArgumentsConstructorStub( |
2008 Isolate* isolate, | 2007 Isolate* isolate, |
2009 ElementsKind kind, | 2008 ElementsKind kind, |
2010 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) | 2009 AllocationSiteOverrideMode override_mode = DONT_OVERRIDE) |
2011 : ArrayConstructorStubBase(isolate, kind, override_mode) { | 2010 : ArrayConstructorStubBase(isolate, kind, override_mode) { |
2012 } | 2011 } |
2013 | 2012 |
2014 private: | 2013 private: |
2015 virtual void PrintName(OStream& os) const { // NOLINT | 2014 virtual void PrintName(OStream& os) const { // NOLINT |
2016 BasePrintName(os, "ArrayNArgumentsConstructorStub"); | 2015 BasePrintName(os, "ArrayNArgumentsConstructorStub"); |
2017 } | 2016 } |
2018 | 2017 |
2018 DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor); | |
2019 DEFINE_HYDROGEN_CODE_STUB(ArrayNArgumentsConstructor, | 2019 DEFINE_HYDROGEN_CODE_STUB(ArrayNArgumentsConstructor, |
2020 ArrayConstructorStubBase); | 2020 ArrayConstructorStubBase); |
2021 }; | 2021 }; |
2022 | 2022 |
2023 | 2023 |
2024 class InternalArrayConstructorStubBase : public HydrogenCodeStub { | 2024 class InternalArrayConstructorStubBase : public HydrogenCodeStub { |
2025 public: | 2025 public: |
2026 InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind) | 2026 InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind) |
2027 : HydrogenCodeStub(isolate) { | 2027 : HydrogenCodeStub(isolate) { |
2028 set_sub_minor_key(ElementsKindBits::encode(kind)); | 2028 set_sub_minor_key(ElementsKindBits::encode(kind)); |
(...skipping 15 matching lines...) Expand all Loading... | |
2044 }; | 2044 }; |
2045 | 2045 |
2046 | 2046 |
2047 class InternalArrayNoArgumentConstructorStub : public | 2047 class InternalArrayNoArgumentConstructorStub : public |
2048 InternalArrayConstructorStubBase { | 2048 InternalArrayConstructorStubBase { |
2049 public: | 2049 public: |
2050 InternalArrayNoArgumentConstructorStub(Isolate* isolate, | 2050 InternalArrayNoArgumentConstructorStub(Isolate* isolate, |
2051 ElementsKind kind) | 2051 ElementsKind kind) |
2052 : InternalArrayConstructorStubBase(isolate, kind) { } | 2052 : InternalArrayConstructorStubBase(isolate, kind) { } |
2053 | 2053 |
2054 DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructorConstantArgCount); | |
2054 DEFINE_HYDROGEN_CODE_STUB(InternalArrayNoArgumentConstructor, | 2055 DEFINE_HYDROGEN_CODE_STUB(InternalArrayNoArgumentConstructor, |
2055 InternalArrayConstructorStubBase); | 2056 InternalArrayConstructorStubBase); |
2056 }; | 2057 }; |
2057 | 2058 |
2058 | 2059 |
2059 class InternalArraySingleArgumentConstructorStub : public | 2060 class InternalArraySingleArgumentConstructorStub : public |
2060 InternalArrayConstructorStubBase { | 2061 InternalArrayConstructorStubBase { |
2061 public: | 2062 public: |
2062 InternalArraySingleArgumentConstructorStub(Isolate* isolate, | 2063 InternalArraySingleArgumentConstructorStub(Isolate* isolate, |
2063 ElementsKind kind) | 2064 ElementsKind kind) |
2064 : InternalArrayConstructorStubBase(isolate, kind) { } | 2065 : InternalArrayConstructorStubBase(isolate, kind) { } |
2065 | 2066 |
2067 DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor); | |
2066 DEFINE_HYDROGEN_CODE_STUB(InternalArraySingleArgumentConstructor, | 2068 DEFINE_HYDROGEN_CODE_STUB(InternalArraySingleArgumentConstructor, |
2067 InternalArrayConstructorStubBase); | 2069 InternalArrayConstructorStubBase); |
2068 }; | 2070 }; |
2069 | 2071 |
2070 | 2072 |
2071 class InternalArrayNArgumentsConstructorStub : public | 2073 class InternalArrayNArgumentsConstructorStub : public |
2072 InternalArrayConstructorStubBase { | 2074 InternalArrayConstructorStubBase { |
2073 public: | 2075 public: |
2074 InternalArrayNArgumentsConstructorStub(Isolate* isolate, ElementsKind kind) | 2076 InternalArrayNArgumentsConstructorStub(Isolate* isolate, ElementsKind kind) |
2075 : InternalArrayConstructorStubBase(isolate, kind) { } | 2077 : InternalArrayConstructorStubBase(isolate, kind) { } |
2076 | 2078 |
2079 DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor); | |
2077 DEFINE_HYDROGEN_CODE_STUB(InternalArrayNArgumentsConstructor, | 2080 DEFINE_HYDROGEN_CODE_STUB(InternalArrayNArgumentsConstructor, |
2078 InternalArrayConstructorStubBase); | 2081 InternalArrayConstructorStubBase); |
2079 }; | 2082 }; |
2080 | 2083 |
2081 | 2084 |
2082 class StoreElementStub : public PlatformCodeStub { | 2085 class StoreElementStub : public PlatformCodeStub { |
2083 public: | 2086 public: |
2084 StoreElementStub(Isolate* isolate, ElementsKind elements_kind) | 2087 StoreElementStub(Isolate* isolate, ElementsKind elements_kind) |
2085 : PlatformCodeStub(isolate) { | 2088 : PlatformCodeStub(isolate) { |
2086 minor_key_ = ElementsKindBits::encode(elements_kind); | 2089 minor_key_ = ElementsKindBits::encode(elements_kind); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2172 | 2175 |
2173 private: | 2176 private: |
2174 ToBooleanStub(Isolate* isolate, InitializationState init_state) | 2177 ToBooleanStub(Isolate* isolate, InitializationState init_state) |
2175 : HydrogenCodeStub(isolate, init_state) { | 2178 : HydrogenCodeStub(isolate, init_state) { |
2176 set_sub_minor_key(ResultModeBits::encode(RESULT_AS_SMI)); | 2179 set_sub_minor_key(ResultModeBits::encode(RESULT_AS_SMI)); |
2177 } | 2180 } |
2178 | 2181 |
2179 class TypesBits : public BitField<byte, 0, NUMBER_OF_TYPES> {}; | 2182 class TypesBits : public BitField<byte, 0, NUMBER_OF_TYPES> {}; |
2180 class ResultModeBits : public BitField<ResultMode, NUMBER_OF_TYPES, 2> {}; | 2183 class ResultModeBits : public BitField<ResultMode, NUMBER_OF_TYPES, 2> {}; |
2181 | 2184 |
2185 DEFINE_CALL_INTERFACE_DESCRIPTOR(ToBoolean); | |
2182 DEFINE_HYDROGEN_CODE_STUB(ToBoolean, HydrogenCodeStub); | 2186 DEFINE_HYDROGEN_CODE_STUB(ToBoolean, HydrogenCodeStub); |
2183 }; | 2187 }; |
2184 | 2188 |
2185 | 2189 |
2186 OStream& operator<<(OStream& os, const ToBooleanStub::Types& t); | 2190 OStream& operator<<(OStream& os, const ToBooleanStub::Types& t); |
2187 | 2191 |
2188 | 2192 |
2189 class ElementsTransitionAndStoreStub : public HydrogenCodeStub { | 2193 class ElementsTransitionAndStoreStub : public HydrogenCodeStub { |
2190 public: | 2194 public: |
2191 ElementsTransitionAndStoreStub(Isolate* isolate, ElementsKind from_kind, | 2195 ElementsTransitionAndStoreStub(Isolate* isolate, ElementsKind from_kind, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2225 static const Register ObjectRegister() { | 2229 static const Register ObjectRegister() { |
2226 return ElementTransitionAndStoreDescriptor::ReceiverRegister(); | 2230 return ElementTransitionAndStoreDescriptor::ReceiverRegister(); |
2227 } | 2231 } |
2228 | 2232 |
2229 private: | 2233 private: |
2230 class FromBits : public BitField<ElementsKind, 0, 8> {}; | 2234 class FromBits : public BitField<ElementsKind, 0, 8> {}; |
2231 class ToBits : public BitField<ElementsKind, 8, 8> {}; | 2235 class ToBits : public BitField<ElementsKind, 8, 8> {}; |
2232 class IsJSArrayBits : public BitField<bool, 16, 1> {}; | 2236 class IsJSArrayBits : public BitField<bool, 16, 1> {}; |
2233 class StoreModeBits : public BitField<KeyedAccessStoreMode, 17, 4> {}; | 2237 class StoreModeBits : public BitField<KeyedAccessStoreMode, 17, 4> {}; |
2234 | 2238 |
2239 DEFINE_CALL_INTERFACE_DESCRIPTOR(ElementTransitionAndStore); | |
2235 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); | 2240 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub); |
2236 }; | 2241 }; |
2237 | 2242 |
2238 | 2243 |
2239 class StoreArrayLiteralElementStub : public PlatformCodeStub { | 2244 class StoreArrayLiteralElementStub : public PlatformCodeStub { |
2240 public: | 2245 public: |
2241 explicit StoreArrayLiteralElementStub(Isolate* isolate) | 2246 explicit StoreArrayLiteralElementStub(Isolate* isolate) |
2242 : PlatformCodeStub(isolate) { } | 2247 : PlatformCodeStub(isolate) { } |
2243 | 2248 |
2244 DEFINE_PLATFORM_CODE_STUB(StoreArrayLiteralElement, PlatformCodeStub); | 2249 DEFINE_PLATFORM_CODE_STUB(StoreArrayLiteralElement, PlatformCodeStub); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2312 | 2317 |
2313 | 2318 |
2314 class StringCompareStub : public PlatformCodeStub { | 2319 class StringCompareStub : public PlatformCodeStub { |
2315 public: | 2320 public: |
2316 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 2321 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
2317 | 2322 |
2318 DEFINE_PLATFORM_CODE_STUB(StringCompare, PlatformCodeStub); | 2323 DEFINE_PLATFORM_CODE_STUB(StringCompare, PlatformCodeStub); |
2319 }; | 2324 }; |
2320 | 2325 |
2321 | 2326 |
2327 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | |
2322 #undef DEFINE_PLATFORM_CODE_STUB | 2328 #undef DEFINE_PLATFORM_CODE_STUB |
2323 #undef DEFINE_HANDLER_CODE_STUB | 2329 #undef DEFINE_HANDLER_CODE_STUB |
2324 #undef DEFINE_HYDROGEN_CODE_STUB | 2330 #undef DEFINE_HYDROGEN_CODE_STUB |
2325 #undef DEFINE_CODE_STUB | 2331 #undef DEFINE_CODE_STUB |
2326 #undef DEFINE_CODE_STUB_BASE | 2332 #undef DEFINE_CODE_STUB_BASE |
2327 } } // namespace v8::internal | 2333 } } // namespace v8::internal |
2328 | 2334 |
2329 #endif // V8_CODE_STUBS_H_ | 2335 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |