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

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

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE+liveedit fix. 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
« no previous file with comments | « src/builtins/x87/builtins-x87.cc ('k') | src/compilation-cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5465 matching lines...) Expand 10 before | Expand all | Expand 10 after
5476 ? index_node 5476 ? index_node
5477 : ((element_size_shift > 0) 5477 : ((element_size_shift > 0)
5478 ? WordShl(index_node, IntPtrConstant(element_size_shift)) 5478 ? WordShl(index_node, IntPtrConstant(element_size_shift))
5479 : WordShr(index_node, IntPtrConstant(-element_size_shift))); 5479 : WordShr(index_node, IntPtrConstant(-element_size_shift)));
5480 return IntPtrAdd(IntPtrConstant(base_size), shifted_index); 5480 return IntPtrAdd(IntPtrConstant(base_size), shifted_index);
5481 } 5481 }
5482 5482
5483 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { 5483 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() {
5484 Node* function = 5484 Node* function =
5485 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); 5485 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset);
5486 return LoadObjectField(function, JSFunction::kFeedbackVectorOffset); 5486 Node* cell = LoadObjectField(function, JSFunction::kFeedbackVectorOffset);
5487 return LoadObjectField(cell, Cell::kValueOffset);
5487 } 5488 }
5488 5489
5489 void CodeStubAssembler::UpdateFeedback(Node* feedback, 5490 void CodeStubAssembler::UpdateFeedback(Node* feedback,
5490 Node* type_feedback_vector, 5491 Node* type_feedback_vector,
5491 Node* slot_id) { 5492 Node* slot_id) {
5492 // This method is used for binary op and compare feedback. These 5493 // This method is used for binary op and compare feedback. These
5493 // vector nodes are initialized with a smi 0, so we can simply OR 5494 // vector nodes are initialized with a smi 0, so we can simply OR
5494 // our new feedback in place. 5495 // our new feedback in place.
5495 Node* previous_feedback = 5496 Node* previous_feedback =
5496 LoadFixedArrayElement(type_feedback_vector, slot_id); 5497 LoadFixedArrayElement(type_feedback_vector, slot_id);
(...skipping 2787 matching lines...) Expand 10 before | Expand all | Expand 10 after
8284 Node* const code_entry = 8285 Node* const code_entry =
8285 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); 8286 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag));
8286 8287
8287 Node* const fun = Allocate(JSFunction::kSize); 8288 Node* const fun = Allocate(JSFunction::kSize);
8288 StoreMapNoWriteBarrier(fun, map); 8289 StoreMapNoWriteBarrier(fun, map);
8289 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset, 8290 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset,
8290 Heap::kEmptyFixedArrayRootIndex); 8291 Heap::kEmptyFixedArrayRootIndex);
8291 StoreObjectFieldRoot(fun, JSObject::kElementsOffset, 8292 StoreObjectFieldRoot(fun, JSObject::kElementsOffset,
8292 Heap::kEmptyFixedArrayRootIndex); 8293 Heap::kEmptyFixedArrayRootIndex);
8293 StoreObjectFieldRoot(fun, JSFunction::kFeedbackVectorOffset, 8294 StoreObjectFieldRoot(fun, JSFunction::kFeedbackVectorOffset,
8294 Heap::kEmptyTypeFeedbackVectorRootIndex); 8295 Heap::kUndefinedCellRootIndex);
8295 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset, 8296 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset,
8296 Heap::kTheHoleValueRootIndex); 8297 Heap::kTheHoleValueRootIndex);
8297 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset, 8298 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset,
8298 shared_info); 8299 shared_info);
8299 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context); 8300 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context);
8300 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry, 8301 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry,
8301 MachineType::PointerRepresentation()); 8302 MachineType::PointerRepresentation());
8302 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset, 8303 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset,
8303 Heap::kUndefinedValueRootIndex); 8304 Heap::kUndefinedValueRootIndex);
8304 8305
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
8346 formatted.c_str(), TENURED); 8347 formatted.c_str(), TENURED);
8347 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), 8348 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(),
8348 HeapConstant(string)); 8349 HeapConstant(string));
8349 } 8350 }
8350 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); 8351 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value);
8351 #endif 8352 #endif
8352 } 8353 }
8353 8354
8354 } // namespace internal 8355 } // namespace internal
8355 } // namespace v8 8356 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/x87/builtins-x87.cc ('k') | src/compilation-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698