| Index: src/stub-cache.cc
|
| diff --git a/src/stub-cache.cc b/src/stub-cache.cc
|
| index eec5baf0c26bc9fce0fdf5da6711a27ceed24b2e..b92d2e3141620cc9f91e1362ed522abcfed5f493 100644
|
| --- a/src/stub-cache.cc
|
| +++ b/src/stub-cache.cc
|
| @@ -146,10 +146,10 @@ Handle<Code> StubCache::ComputeMonomorphicIC(
|
| }
|
|
|
| if (kind == Code::LOAD_IC) {
|
| - LoadStubCompiler ic_compiler(isolate(), flag);
|
| + LoadStubCompiler ic_compiler(isolate(), extra_ic_state, flag);
|
| ic = ic_compiler.CompileMonomorphicIC(type, handler, name);
|
| } else if (kind == Code::KEYED_LOAD_IC) {
|
| - KeyedLoadStubCompiler ic_compiler(isolate(), flag);
|
| + KeyedLoadStubCompiler ic_compiler(isolate(), extra_ic_state, flag);
|
| ic = ic_compiler.CompileMonomorphicIC(type, handler, name);
|
| } else if (kind == Code::STORE_IC) {
|
| StoreStubCompiler ic_compiler(isolate(), extra_ic_state);
|
| @@ -418,12 +418,11 @@ static void FillCache(Isolate* isolate, Handle<Code> code) {
|
|
|
|
|
| Code* StubCache::FindCallInitialize(int argc,
|
| - RelocInfo::Mode mode,
|
| + ContextualMode mode,
|
| Code::Kind kind) {
|
| ExtraICState extra_state =
|
| CallICBase::StringStubState::encode(DEFAULT_STRING_STUB) |
|
| - CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT
|
| - ? CONTEXTUAL : NOT_CONTEXTUAL);
|
| + CallICBase::Contextual::encode(mode);
|
| Code::Flags flags =
|
| Code::ComputeFlags(kind, UNINITIALIZED, extra_state, Code::NORMAL, argc);
|
| UnseededNumberDictionary* dictionary =
|
| @@ -438,12 +437,10 @@ Code* StubCache::FindCallInitialize(int argc,
|
|
|
|
|
| Handle<Code> StubCache::ComputeCallInitialize(int argc,
|
| - RelocInfo::Mode mode,
|
| + ContextualMode mode,
|
| Code::Kind kind) {
|
| ExtraICState extra_state =
|
| - CallICBase::StringStubState::encode(DEFAULT_STRING_STUB) |
|
| - CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT
|
| - ? CONTEXTUAL : NOT_CONTEXTUAL);
|
| + CallICBase::ComputeExtraICState(mode, DEFAULT_STRING_STUB);
|
| Code::Flags flags =
|
| Code::ComputeFlags(kind, UNINITIALIZED, extra_state, Code::NORMAL, argc);
|
| Handle<UnseededNumberDictionary> cache =
|
| @@ -458,14 +455,13 @@ Handle<Code> StubCache::ComputeCallInitialize(int argc,
|
| }
|
|
|
|
|
| -Handle<Code> StubCache::ComputeCallInitialize(int argc, RelocInfo::Mode mode) {
|
| +Handle<Code> StubCache::ComputeCallInitialize(int argc, ContextualMode mode) {
|
| return ComputeCallInitialize(argc, mode, Code::CALL_IC);
|
| }
|
|
|
|
|
| Handle<Code> StubCache::ComputeKeyedCallInitialize(int argc) {
|
| - return ComputeCallInitialize(argc, RelocInfo::CODE_TARGET,
|
| - Code::KEYED_CALL_IC);
|
| + return ComputeCallInitialize(argc, NOT_CONTEXTUAL, Code::KEYED_CALL_IC);
|
| }
|
|
|
|
|
| @@ -617,13 +613,12 @@ Handle<Code> StubCache::ComputePolymorphicIC(
|
| Code::StubType type = number_of_valid_types == 1 ? handler->type()
|
| : Code::NORMAL;
|
| if (kind == Code::LOAD_IC) {
|
| - LoadStubCompiler ic_compiler(isolate_);
|
| + LoadStubCompiler ic_compiler(isolate_, extra_ic_state);
|
| return ic_compiler.CompilePolymorphicIC(
|
| types, handlers, name, type, PROPERTY);
|
| } else {
|
| ASSERT(kind == Code::STORE_IC);
|
| - StrictModeFlag strict_mode = StoreIC::GetStrictMode(extra_ic_state);
|
| - StoreStubCompiler ic_compiler(isolate_, strict_mode);
|
| + StoreStubCompiler ic_compiler(isolate_, extra_ic_state);
|
| return ic_compiler.CompilePolymorphicIC(
|
| types, handlers, name, type, PROPERTY);
|
| }
|
| @@ -833,7 +828,9 @@ static MaybeObject* ThrowReferenceError(Isolate* isolate, Name* name) {
|
| HandleScope scope(isolate);
|
| IC ic(IC::NO_EXTRA_FRAME, isolate);
|
| ASSERT(ic.IsLoadStub());
|
| - if (!ic.SlowIsUndeclaredGlobal()) return isolate->heap()->undefined_value();
|
| + if (ic.contextual_mode() == NOT_CONTEXTUAL) {
|
| + return isolate->heap()->undefined_value();
|
| + }
|
|
|
| // Throw a reference error.
|
| Handle<Name> name_handle(name);
|
|
|