OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/interpreter-assembler.h" | 5 #include "src/interpreter/interpreter-assembler.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
541 Node* is_same_native_context = | 541 Node* is_same_native_context = |
542 WordEqual(native_context, LoadNativeContext(context)); | 542 WordEqual(native_context, LoadNativeContext(context)); |
543 GotoUnless(is_same_native_context, &mark_megamorphic); | 543 GotoUnless(is_same_native_context, &mark_megamorphic); |
544 | 544 |
545 // Initialize it to a monomorphic target. | 545 // Initialize it to a monomorphic target. |
546 Node* call_count_slot = IntPtrAdd(slot_id, IntPtrConstant(1)); | 546 Node* call_count_slot = IntPtrAdd(slot_id, IntPtrConstant(1)); |
547 // Count is Smi, so we don't need a write barrier. | 547 // Count is Smi, so we don't need a write barrier. |
548 StoreFixedArrayElement(type_feedback_vector, call_count_slot, | 548 StoreFixedArrayElement(type_feedback_vector, call_count_slot, |
549 SmiTag(Int32Constant(1)), SKIP_WRITE_BARRIER); | 549 SmiTag(Int32Constant(1)), SKIP_WRITE_BARRIER); |
550 | 550 |
551 CreateWeakCellStub weak_cell_stub(isolate()); | 551 CreateWeakCellInFeedbackVector(type_feedback_vector, SmiTag(slot_id), |
Benedikt Meurer
2016/07/28 10:30:45
Awesome!
| |
552 CallStub(weak_cell_stub.GetCallInterfaceDescriptor(), | 552 function); |
553 HeapConstant(weak_cell_stub.GetCode()), context, | |
554 type_feedback_vector, SmiTag(slot_id), function); | |
555 | 553 |
556 // Call using call function builtin. | 554 // Call using call function builtin. |
557 Callable callable = CodeFactory::InterpreterPushArgsAndCall( | 555 Callable callable = CodeFactory::InterpreterPushArgsAndCall( |
558 isolate(), tail_call_mode, CallableType::kJSFunction); | 556 isolate(), tail_call_mode, CallableType::kJSFunction); |
559 Node* code_target = HeapConstant(callable.code()); | 557 Node* code_target = HeapConstant(callable.code()); |
560 Node* ret_value = CallStub(callable.descriptor(), code_target, context, | 558 Node* ret_value = CallStub(callable.descriptor(), code_target, context, |
561 arg_count, first_arg, function); | 559 arg_count, first_arg, function); |
562 return_value.Bind(ret_value); | 560 return_value.Bind(ret_value); |
563 Goto(&end); | 561 Goto(&end); |
564 } | 562 } |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
994 Goto(&loop); | 992 Goto(&loop); |
995 } | 993 } |
996 Bind(&done_loop); | 994 Bind(&done_loop); |
997 | 995 |
998 return array; | 996 return array; |
999 } | 997 } |
1000 | 998 |
1001 } // namespace interpreter | 999 } // namespace interpreter |
1002 } // namespace internal | 1000 } // namespace internal |
1003 } // namespace v8 | 1001 } // namespace v8 |
OLD | NEW |