OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 338 |
339 friend class IC; | 339 friend class IC; |
340 }; | 340 }; |
341 | 341 |
342 | 342 |
343 class KeyedIC: public IC { | 343 class KeyedIC: public IC { |
344 public: | 344 public: |
345 explicit KeyedIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) {} | 345 explicit KeyedIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) {} |
346 virtual ~KeyedIC() {} | 346 virtual ~KeyedIC() {} |
347 | 347 |
348 virtual MaybeObject* GetFastElementStubWithoutMapCheck( | 348 virtual MaybeObject* GetElementStubWithoutMapCheck( |
349 bool is_js_array) = 0; | 349 bool is_js_array, |
350 | |
351 virtual MaybeObject* GetExternalArrayStubWithoutMapCheck( | |
352 JSObject::ElementsKind elements_kind) = 0; | 350 JSObject::ElementsKind elements_kind) = 0; |
353 | 351 |
354 protected: | 352 protected: |
355 virtual Code* string_stub() { | 353 virtual Code* string_stub() { |
356 return NULL; | 354 return NULL; |
357 } | 355 } |
358 | 356 |
359 virtual Code::Kind kind() const = 0; | 357 virtual Code::Kind kind() const = 0; |
360 | 358 |
361 MaybeObject* ComputeStub(JSObject* receiver, | 359 MaybeObject* ComputeStub(JSObject* receiver, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 static void GenerateIndexedInterceptor(MacroAssembler* masm); | 406 static void GenerateIndexedInterceptor(MacroAssembler* masm); |
409 static void GenerateNonStrictArguments(MacroAssembler* masm); | 407 static void GenerateNonStrictArguments(MacroAssembler* masm); |
410 | 408 |
411 // Bit mask to be tested against bit field for the cases when | 409 // Bit mask to be tested against bit field for the cases when |
412 // generic stub should go into slow case. | 410 // generic stub should go into slow case. |
413 // Access check is necessary explicitly since generic stub does not perform | 411 // Access check is necessary explicitly since generic stub does not perform |
414 // map checks. | 412 // map checks. |
415 static const int kSlowCaseBitFieldMask = | 413 static const int kSlowCaseBitFieldMask = |
416 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); | 414 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
417 | 415 |
418 virtual MaybeObject* GetFastElementStubWithoutMapCheck( | 416 virtual MaybeObject* GetElementStubWithoutMapCheck( |
419 bool is_js_array); | 417 bool is_js_array, |
420 | |
421 virtual MaybeObject* GetExternalArrayStubWithoutMapCheck( | |
422 JSObject::ElementsKind elements_kind); | 418 JSObject::ElementsKind elements_kind); |
423 | 419 |
424 protected: | 420 protected: |
425 virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; } | 421 virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; } |
426 | 422 |
427 virtual MaybeObject* ConstructMegamorphicStub( | 423 virtual MaybeObject* ConstructMegamorphicStub( |
428 MapList* receiver_maps, | 424 MapList* receiver_maps, |
429 CodeList* targets, | 425 CodeList* targets, |
430 StrictModeFlag strict_mode); | 426 StrictModeFlag strict_mode); |
431 | 427 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 static void GenerateInitialize(MacroAssembler* masm) { | 557 static void GenerateInitialize(MacroAssembler* masm) { |
562 GenerateMiss(masm, false); | 558 GenerateMiss(masm, false); |
563 } | 559 } |
564 static void GenerateMiss(MacroAssembler* masm, bool force_generic); | 560 static void GenerateMiss(MacroAssembler* masm, bool force_generic); |
565 static void GenerateSlow(MacroAssembler* masm); | 561 static void GenerateSlow(MacroAssembler* masm); |
566 static void GenerateRuntimeSetProperty(MacroAssembler* masm, | 562 static void GenerateRuntimeSetProperty(MacroAssembler* masm, |
567 StrictModeFlag strict_mode); | 563 StrictModeFlag strict_mode); |
568 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); | 564 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); |
569 static void GenerateNonStrictArguments(MacroAssembler* masm); | 565 static void GenerateNonStrictArguments(MacroAssembler* masm); |
570 | 566 |
571 virtual MaybeObject* GetFastElementStubWithoutMapCheck( | 567 virtual MaybeObject* GetElementStubWithoutMapCheck( |
572 bool is_js_array); | 568 bool is_js_array, |
573 | |
574 virtual MaybeObject* GetExternalArrayStubWithoutMapCheck( | |
575 JSObject::ElementsKind elements_kind); | 569 JSObject::ElementsKind elements_kind); |
576 | 570 |
577 protected: | 571 protected: |
578 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } | 572 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } |
579 | 573 |
580 virtual MaybeObject* ConstructMegamorphicStub( | 574 virtual MaybeObject* ConstructMegamorphicStub( |
581 MapList* receiver_maps, | 575 MapList* receiver_maps, |
582 CodeList* targets, | 576 CodeList* targets, |
583 StrictModeFlag strict_mode); | 577 StrictModeFlag strict_mode); |
584 | 578 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 | 720 |
727 Token::Value op_; | 721 Token::Value op_; |
728 }; | 722 }; |
729 | 723 |
730 // Helper for BinaryOpIC and CompareIC. | 724 // Helper for BinaryOpIC and CompareIC. |
731 void PatchInlinedSmiCode(Address address); | 725 void PatchInlinedSmiCode(Address address); |
732 | 726 |
733 } } // namespace v8::internal | 727 } } // namespace v8::internal |
734 | 728 |
735 #endif // V8_IC_H_ | 729 #endif // V8_IC_H_ |
OLD | NEW |