| 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, |
| 362 bool is_store, | 360 bool is_store, |
| 363 StrictModeFlag strict_mode, | 361 StrictModeFlag strict_mode, |
| 364 Code* default_stub); | 362 Code* default_stub); |
| 365 | 363 |
| 366 virtual MaybeObject* ConstructMegamorphicStub( | 364 virtual MaybeObject* ConstructMegamorphicStub( |
| 367 MapList* receiver_maps, | 365 MapList* receiver_maps, |
| 368 CodeList* targets, | 366 CodeList* targets, |
| 369 StrictModeFlag strict_mode) = 0; | 367 StrictModeFlag strict_mode) = 0; |
| 370 | 368 |
| 371 private: | 369 private: |
| 372 void GetReceiverMapsForStub(Code* stub, MapList* result); | 370 void GetReceiverMapsForStub(Code* stub, MapList* result); |
| 373 | 371 |
| 374 MaybeObject* ComputeMonomorphicStubWithoutMapCheck( | 372 MaybeObject* ComputeMonomorphicStubWithoutMapCheck( |
| 375 Map* receiver_map, | 373 Map* receiver_map, |
| 376 StrictModeFlag strict_mode, | 374 StrictModeFlag strict_mode); |
| 377 Code* generic_stub); | |
| 378 | 375 |
| 379 MaybeObject* ComputeMonomorphicStub(JSObject* receiver, | 376 MaybeObject* ComputeMonomorphicStub(JSObject* receiver, |
| 380 bool is_store, | 377 bool is_store, |
| 381 StrictModeFlag strict_mode, | 378 StrictModeFlag strict_mode, |
| 382 Code* default_stub); | 379 Code* default_stub); |
| 383 }; | 380 }; |
| 384 | 381 |
| 385 | 382 |
| 386 class KeyedLoadIC: public KeyedIC { | 383 class KeyedLoadIC: public KeyedIC { |
| 387 public: | 384 public: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 408 static void GenerateIndexedInterceptor(MacroAssembler* masm); | 405 static void GenerateIndexedInterceptor(MacroAssembler* masm); |
| 409 static void GenerateNonStrictArguments(MacroAssembler* masm); | 406 static void GenerateNonStrictArguments(MacroAssembler* masm); |
| 410 | 407 |
| 411 // Bit mask to be tested against bit field for the cases when | 408 // Bit mask to be tested against bit field for the cases when |
| 412 // generic stub should go into slow case. | 409 // generic stub should go into slow case. |
| 413 // Access check is necessary explicitly since generic stub does not perform | 410 // Access check is necessary explicitly since generic stub does not perform |
| 414 // map checks. | 411 // map checks. |
| 415 static const int kSlowCaseBitFieldMask = | 412 static const int kSlowCaseBitFieldMask = |
| 416 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); | 413 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
| 417 | 414 |
| 418 virtual MaybeObject* GetFastElementStubWithoutMapCheck( | 415 virtual MaybeObject* GetElementStubWithoutMapCheck( |
| 419 bool is_js_array); | 416 bool is_js_array, |
| 420 | |
| 421 virtual MaybeObject* GetExternalArrayStubWithoutMapCheck( | |
| 422 JSObject::ElementsKind elements_kind); | 417 JSObject::ElementsKind elements_kind); |
| 423 | 418 |
| 424 protected: | 419 protected: |
| 425 virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; } | 420 virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; } |
| 426 | 421 |
| 427 virtual MaybeObject* ConstructMegamorphicStub( | 422 virtual MaybeObject* ConstructMegamorphicStub( |
| 428 MapList* receiver_maps, | 423 MapList* receiver_maps, |
| 429 CodeList* targets, | 424 CodeList* targets, |
| 430 StrictModeFlag strict_mode); | 425 StrictModeFlag strict_mode); |
| 431 | 426 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 static void GenerateInitialize(MacroAssembler* masm) { | 556 static void GenerateInitialize(MacroAssembler* masm) { |
| 562 GenerateMiss(masm, false); | 557 GenerateMiss(masm, false); |
| 563 } | 558 } |
| 564 static void GenerateMiss(MacroAssembler* masm, bool force_generic); | 559 static void GenerateMiss(MacroAssembler* masm, bool force_generic); |
| 565 static void GenerateSlow(MacroAssembler* masm); | 560 static void GenerateSlow(MacroAssembler* masm); |
| 566 static void GenerateRuntimeSetProperty(MacroAssembler* masm, | 561 static void GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 567 StrictModeFlag strict_mode); | 562 StrictModeFlag strict_mode); |
| 568 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); | 563 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); |
| 569 static void GenerateNonStrictArguments(MacroAssembler* masm); | 564 static void GenerateNonStrictArguments(MacroAssembler* masm); |
| 570 | 565 |
| 571 virtual MaybeObject* GetFastElementStubWithoutMapCheck( | 566 virtual MaybeObject* GetElementStubWithoutMapCheck( |
| 572 bool is_js_array); | 567 bool is_js_array, |
| 573 | |
| 574 virtual MaybeObject* GetExternalArrayStubWithoutMapCheck( | |
| 575 JSObject::ElementsKind elements_kind); | 568 JSObject::ElementsKind elements_kind); |
| 576 | 569 |
| 577 protected: | 570 protected: |
| 578 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } | 571 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } |
| 579 | 572 |
| 580 virtual MaybeObject* ConstructMegamorphicStub( | 573 virtual MaybeObject* ConstructMegamorphicStub( |
| 581 MapList* receiver_maps, | 574 MapList* receiver_maps, |
| 582 CodeList* targets, | 575 CodeList* targets, |
| 583 StrictModeFlag strict_mode); | 576 StrictModeFlag strict_mode); |
| 584 | 577 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 | 719 |
| 727 Token::Value op_; | 720 Token::Value op_; |
| 728 }; | 721 }; |
| 729 | 722 |
| 730 // Helper for BinaryOpIC and CompareIC. | 723 // Helper for BinaryOpIC and CompareIC. |
| 731 void PatchInlinedSmiCode(Address address); | 724 void PatchInlinedSmiCode(Address address); |
| 732 | 725 |
| 733 } } // namespace v8::internal | 726 } } // namespace v8::internal |
| 734 | 727 |
| 735 #endif // V8_IC_H_ | 728 #endif // V8_IC_H_ |
| OLD | NEW |