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 #include "src/ic/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 if (receiver->IsUndefined() || receiver->IsNull()) return; | 325 if (receiver->IsUndefined() || receiver->IsNull()) return; |
326 | 326 |
327 // Remove the target from the code cache if it became invalid | 327 // Remove the target from the code cache if it became invalid |
328 // because of changes in the prototype chain to avoid hitting it | 328 // because of changes in the prototype chain to avoid hitting it |
329 // again. | 329 // again. |
330 if (TryRemoveInvalidPrototypeDependentStub(receiver, | 330 if (TryRemoveInvalidPrototypeDependentStub(receiver, |
331 Handle<String>::cast(name))) { | 331 Handle<String>::cast(name))) { |
332 MarkPrototypeFailure(name); | 332 MarkPrototypeFailure(name); |
333 return; | 333 return; |
334 } | 334 } |
335 | |
336 // The builtins object is special. It only changes when JavaScript | |
337 // builtins are loaded lazily. It is important to keep inline | |
338 // caches for the builtins object monomorphic. Therefore, if we get | |
339 // an inline cache miss for the builtins object after lazily loading | |
340 // JavaScript builtins, we return uninitialized as the state to | |
341 // force the inline cache back to monomorphic state. | |
342 if (receiver->IsJSBuiltinsObject()) state_ = PREMONOMORPHIC; | |
343 } | 335 } |
344 | 336 |
345 | 337 |
346 MaybeHandle<Object> IC::TypeError(MessageTemplate::Template index, | 338 MaybeHandle<Object> IC::TypeError(MessageTemplate::Template index, |
347 Handle<Object> object, Handle<Object> key) { | 339 Handle<Object> object, Handle<Object> key) { |
348 HandleScope scope(isolate()); | 340 HandleScope scope(isolate()); |
349 THROW_NEW_ERROR(isolate(), NewTypeError(index, key, object), Object); | 341 THROW_NEW_ERROR(isolate(), NewTypeError(index, key, object), Object); |
350 } | 342 } |
351 | 343 |
352 | 344 |
(...skipping 2796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3149 KeyedLoadICNexus nexus(vector, vector_slot); | 3141 KeyedLoadICNexus nexus(vector, vector_slot); |
3150 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3142 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3151 ic.UpdateState(receiver, key); | 3143 ic.UpdateState(receiver, key); |
3152 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 3144 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
3153 } | 3145 } |
3154 | 3146 |
3155 return *result; | 3147 return *result; |
3156 } | 3148 } |
3157 } // namespace internal | 3149 } // namespace internal |
3158 } // namespace v8 | 3150 } // namespace v8 |
OLD | NEW |