| 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_IC_H_ | 5 #ifndef V8_IC_H_ |
| 6 #define V8_IC_H_ | 6 #define V8_IC_H_ |
| 7 | 7 |
| 8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
| 9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
| 10 #include "src/messages.h" | 10 #include "src/messages.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 357 |
| 358 | 358 |
| 359 class StoreIC : public IC { | 359 class StoreIC : public IC { |
| 360 public: | 360 public: |
| 361 StoreIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) | 361 StoreIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) |
| 362 : IC(depth, isolate, nexus) { | 362 : IC(depth, isolate, nexus) { |
| 363 DCHECK(IsStoreStub()); | 363 DCHECK(IsStoreStub()); |
| 364 } | 364 } |
| 365 | 365 |
| 366 LanguageMode language_mode() const { | 366 LanguageMode language_mode() const { |
| 367 return StoreICState::GetLanguageMode(extra_ic_state()); | 367 return nexus()->vector()->GetLanguageMode(nexus()->slot()); |
| 368 } | 368 } |
| 369 | 369 |
| 370 MUST_USE_RESULT MaybeHandle<Object> Store( | 370 MUST_USE_RESULT MaybeHandle<Object> Store( |
| 371 Handle<Object> object, Handle<Name> name, Handle<Object> value, | 371 Handle<Object> object, Handle<Name> name, Handle<Object> value, |
| 372 JSReceiver::StoreFromKeyed store_mode = | 372 JSReceiver::StoreFromKeyed store_mode = |
| 373 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); | 373 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); |
| 374 | 374 |
| 375 bool LookupForWrite(LookupIterator* it, Handle<Object> value, | 375 bool LookupForWrite(LookupIterator* it, Handle<Object> value, |
| 376 JSReceiver::StoreFromKeyed store_mode); | 376 JSReceiver::StoreFromKeyed store_mode); |
| 377 | 377 |
| 378 static void Clear(Isolate* isolate, Code* host, StoreICNexus* nexus); | 378 static void Clear(Isolate* isolate, Code* host, StoreICNexus* nexus); |
| 379 | 379 |
| 380 protected: | 380 protected: |
| 381 // Stub accessors. | 381 // Stub accessors. |
| 382 Handle<Code> slow_stub() const { | 382 Handle<Code> slow_stub() const { |
| 383 // TODO(ishell): don't hard-code language mode into the handler because |
| 384 // this handler can be re-used through megamorphic stub cache for wrong |
| 385 // language mode. |
| 386 // The slow stub must decode the language mode from the IC kind. |
| 383 switch (language_mode()) { | 387 switch (language_mode()) { |
| 384 case SLOPPY: | 388 case SLOPPY: |
| 385 return isolate()->builtins()->StoreIC_SlowSloppy(); | 389 return isolate()->builtins()->StoreIC_SlowSloppy(); |
| 386 case STRICT: | 390 case STRICT: |
| 387 return isolate()->builtins()->StoreIC_SlowStrict(); | 391 return isolate()->builtins()->StoreIC_SlowStrict(); |
| 388 default: | 392 default: |
| 389 UNREACHABLE(); | 393 UNREACHABLE(); |
| 390 return Handle<Code>(); | 394 return Handle<Code>(); |
| 391 } | 395 } |
| 392 } | 396 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 501 |
| 498 // Helper for BinaryOpIC and CompareIC. | 502 // Helper for BinaryOpIC and CompareIC. |
| 499 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 503 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 500 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 504 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
| 501 InlinedSmiCheck check); | 505 InlinedSmiCheck check); |
| 502 | 506 |
| 503 } // namespace internal | 507 } // namespace internal |
| 504 } // namespace v8 | 508 } // namespace v8 |
| 505 | 509 |
| 506 #endif // V8_IC_H_ | 510 #endif // V8_IC_H_ |
| OLD | NEW |