Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: src/code-stub-assembler.cc

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #include "src/code-stub-assembler.h" 4 #include "src/code-stub-assembler.h"
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/frames-inl.h" 6 #include "src/frames-inl.h"
7 #include "src/frames.h" 7 #include "src/frames.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 5528 matching lines...) Expand 10 before | Expand all | Expand 10 after
5539 ? index_node 5539 ? index_node
5540 : ((element_size_shift > 0) 5540 : ((element_size_shift > 0)
5541 ? WordShl(index_node, IntPtrConstant(element_size_shift)) 5541 ? WordShl(index_node, IntPtrConstant(element_size_shift))
5542 : WordShr(index_node, IntPtrConstant(-element_size_shift))); 5542 : WordShr(index_node, IntPtrConstant(-element_size_shift)));
5543 return IntPtrAdd(IntPtrConstant(base_size), shifted_index); 5543 return IntPtrAdd(IntPtrConstant(base_size), shifted_index);
5544 } 5544 }
5545 5545
5546 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { 5546 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() {
5547 Node* function = 5547 Node* function =
5548 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); 5548 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset);
5549 return LoadObjectField(function, JSFunction::kFeedbackVectorOffset); 5549 Node* cell = LoadObjectField(function, JSFunction::kFeedbackVectorOffset);
5550 return LoadObjectField(cell, Cell::kValueOffset);
5550 } 5551 }
5551 5552
5552 void CodeStubAssembler::UpdateFeedback(Node* feedback, 5553 void CodeStubAssembler::UpdateFeedback(Node* feedback,
5553 Node* type_feedback_vector, 5554 Node* type_feedback_vector,
5554 Node* slot_id) { 5555 Node* slot_id) {
5555 // This method is used for binary op and compare feedback. These 5556 // This method is used for binary op and compare feedback. These
5556 // vector nodes are initialized with a smi 0, so we can simply OR 5557 // vector nodes are initialized with a smi 0, so we can simply OR
5557 // our new feedback in place. 5558 // our new feedback in place.
5558 Node* previous_feedback = 5559 Node* previous_feedback =
5559 LoadFixedArrayElement(type_feedback_vector, slot_id); 5560 LoadFixedArrayElement(type_feedback_vector, slot_id);
(...skipping 2787 matching lines...) Expand 10 before | Expand all | Expand 10 after
8347 Node* const code_entry = 8348 Node* const code_entry =
8348 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); 8349 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag));
8349 8350
8350 Node* const fun = Allocate(JSFunction::kSize); 8351 Node* const fun = Allocate(JSFunction::kSize);
8351 StoreMapNoWriteBarrier(fun, map); 8352 StoreMapNoWriteBarrier(fun, map);
8352 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset, 8353 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset,
8353 Heap::kEmptyFixedArrayRootIndex); 8354 Heap::kEmptyFixedArrayRootIndex);
8354 StoreObjectFieldRoot(fun, JSObject::kElementsOffset, 8355 StoreObjectFieldRoot(fun, JSObject::kElementsOffset,
8355 Heap::kEmptyFixedArrayRootIndex); 8356 Heap::kEmptyFixedArrayRootIndex);
8356 StoreObjectFieldRoot(fun, JSFunction::kFeedbackVectorOffset, 8357 StoreObjectFieldRoot(fun, JSFunction::kFeedbackVectorOffset,
8357 Heap::kEmptyTypeFeedbackVectorRootIndex); 8358 Heap::kUndefinedCellRootIndex);
8358 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset, 8359 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset,
8359 Heap::kTheHoleValueRootIndex); 8360 Heap::kTheHoleValueRootIndex);
8360 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset, 8361 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset,
8361 shared_info); 8362 shared_info);
8362 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context); 8363 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context);
8363 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry, 8364 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry,
8364 MachineType::PointerRepresentation()); 8365 MachineType::PointerRepresentation());
8365 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset, 8366 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset,
8366 Heap::kUndefinedValueRootIndex); 8367 Heap::kUndefinedValueRootIndex);
8367 8368
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
8409 formatted.c_str(), TENURED); 8410 formatted.c_str(), TENURED);
8410 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), 8411 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(),
8411 HeapConstant(string)); 8412 HeapConstant(string));
8412 } 8413 }
8413 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); 8414 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value);
8414 #endif 8415 #endif
8415 } 8416 }
8416 8417
8417 } // namespace internal 8418 } // namespace internal
8418 } // namespace v8 8419 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/x87/builtins-x87.cc ('k') | src/compilation-cache.h » ('j') | src/debug/liveedit.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698