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/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 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2110 | 2110 |
2111 assembler.Comment("StoreScriptContextFieldStub: context_index=%d, slot=%d", | 2111 assembler.Comment("StoreScriptContextFieldStub: context_index=%d, slot=%d", |
2112 context_index(), slot_index()); | 2112 context_index(), slot_index()); |
2113 | 2113 |
2114 Node* value = assembler.Parameter(Descriptor::kValue); | 2114 Node* value = assembler.Parameter(Descriptor::kValue); |
2115 Node* context = assembler.Parameter(Descriptor::kContext); | 2115 Node* context = assembler.Parameter(Descriptor::kContext); |
2116 | 2116 |
2117 Node* script_context = assembler.LoadScriptContext(context, context_index()); | 2117 Node* script_context = assembler.LoadScriptContext(context, context_index()); |
2118 assembler.StoreFixedArrayElement( | 2118 assembler.StoreFixedArrayElement( |
2119 script_context, assembler.IntPtrConstant(slot_index()), value, | 2119 script_context, assembler.IntPtrConstant(slot_index()), value, |
2120 UPDATE_WRITE_BARRIER, 0, CodeStubAssembler::INTPTR_PARAMETERS); | 2120 UPDATE_WRITE_BARRIER, CodeStubAssembler::INTPTR_PARAMETERS); |
2121 assembler.Return(value); | 2121 assembler.Return(value); |
2122 } | 2122 } |
2123 | 2123 |
2124 void StoreInterceptorStub::GenerateAssembly( | 2124 void StoreInterceptorStub::GenerateAssembly( |
2125 compiler::CodeAssemblerState* state) const { | 2125 compiler::CodeAssemblerState* state) const { |
2126 typedef compiler::Node Node; | 2126 typedef compiler::Node Node; |
2127 CodeStubAssembler assembler(state); | 2127 CodeStubAssembler assembler(state); |
2128 | 2128 |
2129 Node* receiver = assembler.Parameter(Descriptor::kReceiver); | 2129 Node* receiver = assembler.Parameter(Descriptor::kReceiver); |
2130 Node* name = assembler.Parameter(Descriptor::kName); | 2130 Node* name = assembler.Parameter(Descriptor::kName); |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2614 | 2614 |
2615 Isolate* isolate = assembler->isolate(); | 2615 Isolate* isolate = assembler->isolate(); |
2616 assembler->StoreMapNoWriteBarrier( | 2616 assembler->StoreMapNoWriteBarrier( |
2617 function_context, | 2617 function_context, |
2618 assembler->HeapConstant(isolate->factory()->function_context_map())); | 2618 assembler->HeapConstant(isolate->factory()->function_context_map())); |
2619 assembler->StoreObjectFieldNoWriteBarrier(function_context, | 2619 assembler->StoreObjectFieldNoWriteBarrier(function_context, |
2620 Context::kLengthOffset, | 2620 Context::kLengthOffset, |
2621 assembler->SmiFromWord32(length)); | 2621 assembler->SmiFromWord32(length)); |
2622 | 2622 |
2623 // Set up the fixed slots. | 2623 // Set up the fixed slots. |
2624 assembler->StoreFixedArrayElement(function_context, Context::CLOSURE_INDEX, | 2624 assembler->StoreFixedArrayElement( |
2625 function, SKIP_WRITE_BARRIER); | 2625 function_context, assembler->Int32Constant(Context::CLOSURE_INDEX), |
2626 assembler->StoreFixedArrayElement(function_context, Context::PREVIOUS_INDEX, | 2626 function, SKIP_WRITE_BARRIER); |
2627 context, SKIP_WRITE_BARRIER); | 2627 assembler->StoreFixedArrayElement( |
2628 assembler->StoreFixedArrayElement(function_context, Context::EXTENSION_INDEX, | 2628 function_context, assembler->Int32Constant(Context::PREVIOUS_INDEX), |
2629 assembler->TheHoleConstant(), | 2629 context, SKIP_WRITE_BARRIER); |
2630 SKIP_WRITE_BARRIER); | 2630 assembler->StoreFixedArrayElement( |
| 2631 function_context, assembler->Int32Constant(Context::EXTENSION_INDEX), |
| 2632 assembler->TheHoleConstant(), SKIP_WRITE_BARRIER); |
2631 | 2633 |
2632 // Copy the native context from the previous context. | 2634 // Copy the native context from the previous context. |
2633 Node* native_context = assembler->LoadNativeContext(context); | 2635 Node* native_context = assembler->LoadNativeContext(context); |
2634 assembler->StoreFixedArrayElement(function_context, | 2636 assembler->StoreFixedArrayElement( |
2635 Context::NATIVE_CONTEXT_INDEX, | 2637 function_context, assembler->Int32Constant(Context::NATIVE_CONTEXT_INDEX), |
2636 native_context, SKIP_WRITE_BARRIER); | 2638 native_context, SKIP_WRITE_BARRIER); |
2637 | 2639 |
2638 // Initialize the rest of the slots to undefined. | 2640 // Initialize the rest of the slots to undefined. |
2639 Node* undefined = assembler->UndefinedConstant(); | 2641 Node* undefined = assembler->UndefinedConstant(); |
2640 assembler->BuildFastFixedArrayForEach( | 2642 assembler->BuildFastFixedArrayForEach( |
2641 function_context, FAST_ELEMENTS, min_context_slots, length, | 2643 function_context, FAST_ELEMENTS, min_context_slots, length, |
2642 [undefined](CodeStubAssembler* assembler, Node* context, Node* offset) { | 2644 [undefined](CodeStubAssembler* assembler, Node* context, Node* offset) { |
2643 assembler->StoreNoWriteBarrier(MachineType::PointerRepresentation(), | 2645 assembler->StoreNoWriteBarrier(MachineType::PointerRepresentation(), |
2644 context, offset, undefined); | 2646 context, offset, undefined); |
2645 }); | 2647 }); |
2646 | 2648 |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3212 } | 3214 } |
3213 | 3215 |
3214 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) | 3216 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
3215 : PlatformCodeStub(isolate) {} | 3217 : PlatformCodeStub(isolate) {} |
3216 | 3218 |
3217 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) | 3219 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) |
3218 : PlatformCodeStub(isolate) {} | 3220 : PlatformCodeStub(isolate) {} |
3219 | 3221 |
3220 } // namespace internal | 3222 } // namespace internal |
3221 } // namespace v8 | 3223 } // namespace v8 |
OLD | NEW |