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

Side by Side Diff: src/code-stubs.cc

Issue 2504153002: [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: REBASE. Created 3 years, 12 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/code-stubs.h ('k') | src/compiler.cc » ('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 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 assembler.Goto(&end); 2431 assembler.Goto(&end);
2432 } 2432 }
2433 2433
2434 assembler.Bind(&end); 2434 assembler.Bind(&end);
2435 assembler.Return(var_result.value()); 2435 assembler.Return(var_result.value());
2436 } 2436 }
2437 2437
2438 // static 2438 // static
2439 compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler, 2439 compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler,
2440 compiler::Node* shared_info, 2440 compiler::Node* shared_info,
2441 compiler::Node* feedback_vector,
2442 compiler::Node* slot,
2441 compiler::Node* context) { 2443 compiler::Node* context) {
2442 typedef compiler::Node Node; 2444 typedef compiler::Node Node;
2443 typedef compiler::CodeAssembler::Label Label; 2445 typedef compiler::CodeAssembler::Label Label;
2444 typedef compiler::CodeAssembler::Variable Variable; 2446 typedef compiler::CodeAssembler::Variable Variable;
2445 2447
2446 Isolate* isolate = assembler->isolate(); 2448 Isolate* isolate = assembler->isolate();
2447 Factory* factory = assembler->isolate()->factory(); 2449 Factory* factory = assembler->isolate()->factory();
2448 assembler->IncrementCounter(isolate->counters()->fast_new_closure_total(), 1); 2450 assembler->IncrementCounter(isolate->counters()->fast_new_closure_total(), 1);
2449 2451
2450 // Create a new closure from the given function info in new space 2452 // Create a new closure from the given function info in new space
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
2544 // Get the function map in the current native context and set that 2546 // Get the function map in the current native context and set that
2545 // as the map of the allocated object. 2547 // as the map of the allocated object.
2546 Node* native_context = assembler->LoadNativeContext(context); 2548 Node* native_context = assembler->LoadNativeContext(context);
2547 Node* map_slot_value = 2549 Node* map_slot_value =
2548 assembler->LoadFixedArrayElement(native_context, map_index.value()); 2550 assembler->LoadFixedArrayElement(native_context, map_index.value());
2549 assembler->StoreMapNoWriteBarrier(result, map_slot_value); 2551 assembler->StoreMapNoWriteBarrier(result, map_slot_value);
2550 2552
2551 // Initialize the rest of the function. 2553 // Initialize the rest of the function.
2552 Node* empty_fixed_array = 2554 Node* empty_fixed_array =
2553 assembler->HeapConstant(factory->empty_fixed_array()); 2555 assembler->HeapConstant(factory->empty_fixed_array());
2554 Node* empty_literals_array =
2555 assembler->HeapConstant(factory->empty_literals_array());
2556 assembler->StoreObjectFieldNoWriteBarrier(result, JSObject::kPropertiesOffset, 2556 assembler->StoreObjectFieldNoWriteBarrier(result, JSObject::kPropertiesOffset,
2557 empty_fixed_array); 2557 empty_fixed_array);
2558 assembler->StoreObjectFieldNoWriteBarrier(result, JSObject::kElementsOffset, 2558 assembler->StoreObjectFieldNoWriteBarrier(result, JSObject::kElementsOffset,
2559 empty_fixed_array); 2559 empty_fixed_array);
2560 Node* literals_array = assembler->LoadFixedArrayElement(
2561 feedback_vector, slot, 0, CodeStubAssembler::SMI_PARAMETERS);
2560 assembler->StoreObjectFieldNoWriteBarrier(result, JSFunction::kLiteralsOffset, 2562 assembler->StoreObjectFieldNoWriteBarrier(result, JSFunction::kLiteralsOffset,
2561 empty_literals_array); 2563 literals_array);
2562 assembler->StoreObjectFieldNoWriteBarrier( 2564 assembler->StoreObjectFieldNoWriteBarrier(
2563 result, JSFunction::kPrototypeOrInitialMapOffset, 2565 result, JSFunction::kPrototypeOrInitialMapOffset,
2564 assembler->TheHoleConstant()); 2566 assembler->TheHoleConstant());
2565 assembler->StoreObjectFieldNoWriteBarrier( 2567 assembler->StoreObjectFieldNoWriteBarrier(
2566 result, JSFunction::kSharedFunctionInfoOffset, shared_info); 2568 result, JSFunction::kSharedFunctionInfoOffset, shared_info);
2567 assembler->StoreObjectFieldNoWriteBarrier(result, JSFunction::kContextOffset, 2569 assembler->StoreObjectFieldNoWriteBarrier(result, JSFunction::kContextOffset,
2568 context); 2570 context);
2569 Handle<Code> lazy_builtin_handle( 2571 Handle<Code> lazy_builtin_handle(
2570 assembler->isolate()->builtins()->builtin(Builtins::kCompileLazy)); 2572 assembler->isolate()->builtins()->builtin(Builtins::kCompileLazy));
2571 Node* lazy_builtin = assembler->HeapConstant(lazy_builtin_handle); 2573 Node* lazy_builtin = assembler->HeapConstant(lazy_builtin_handle);
2572 Node* lazy_builtin_entry = assembler->IntPtrAdd( 2574 Node* lazy_builtin_entry = assembler->IntPtrAdd(
2573 assembler->BitcastTaggedToWord(lazy_builtin), 2575 assembler->BitcastTaggedToWord(lazy_builtin),
2574 assembler->IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); 2576 assembler->IntPtrConstant(Code::kHeaderSize - kHeapObjectTag));
2575 assembler->StoreObjectFieldNoWriteBarrier( 2577 assembler->StoreObjectFieldNoWriteBarrier(
2576 result, JSFunction::kCodeEntryOffset, lazy_builtin_entry, 2578 result, JSFunction::kCodeEntryOffset, lazy_builtin_entry,
2577 MachineType::PointerRepresentation()); 2579 MachineType::PointerRepresentation());
2578 assembler->StoreObjectFieldNoWriteBarrier(result, 2580 assembler->StoreObjectFieldNoWriteBarrier(result,
2579 JSFunction::kNextFunctionLinkOffset, 2581 JSFunction::kNextFunctionLinkOffset,
2580 assembler->UndefinedConstant()); 2582 assembler->UndefinedConstant());
2581 2583
2582 return result; 2584 return result;
2583 } 2585 }
2584 2586
2585 void FastNewClosureStub::GenerateAssembly( 2587 void FastNewClosureStub::GenerateAssembly(
2586 compiler::CodeAssemblerState* state) const { 2588 compiler::CodeAssemblerState* state) const {
2589 CodeStubAssembler assembler(state);
2587 typedef compiler::Node Node; 2590 typedef compiler::Node Node;
2588 CodeStubAssembler assembler(state);
2589 Node* shared = assembler.Parameter(Descriptor::kSharedFunctionInfo); 2591 Node* shared = assembler.Parameter(Descriptor::kSharedFunctionInfo);
2590 Node* context = assembler.Parameter(Descriptor::kContext); 2592 Node* context = assembler.Parameter(Descriptor::kContext);
2591 assembler.Return(Generate(&assembler, shared, context)); 2593 Node* vector = assembler.Parameter(Descriptor::kVector);
2594 Node* slot = assembler.Parameter(Descriptor::kSlot);
2595 assembler.Return(Generate(&assembler, shared, vector, slot, context));
2592 } 2596 }
2593 2597
2594 // static 2598 // static
2595 int FastNewFunctionContextStub::MaximumSlots() { 2599 int FastNewFunctionContextStub::MaximumSlots() {
2596 return FLAG_test_small_max_function_context_stub_size ? kSmallMaximumSlots 2600 return FLAG_test_small_max_function_context_stub_size ? kSmallMaximumSlots
2597 : kMaximumSlots; 2601 : kMaximumSlots;
2598 } 2602 }
2599 2603
2600 // static 2604 // static
2601 compiler::Node* FastNewFunctionContextStub::Generate( 2605 compiler::Node* FastNewFunctionContextStub::Generate(
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
3223 } 3227 }
3224 3228
3225 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) 3229 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
3226 : PlatformCodeStub(isolate) {} 3230 : PlatformCodeStub(isolate) {}
3227 3231
3228 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) 3232 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate)
3229 : PlatformCodeStub(isolate) {} 3233 : PlatformCodeStub(isolate) {}
3230 3234
3231 } // namespace internal 3235 } // namespace internal
3232 } // namespace v8 3236 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698