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

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

Issue 2471033004: [ignition,modules] Introduce bytecodes for loading/storing module variables. (Closed)
Patch Set: More comments. Created 4 years, 1 month 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 #include "src/ic/handler-configuration.h" 8 #include "src/ic/handler-configuration.h"
9 #include "src/ic/stub-cache.h" 9 #include "src/ic/stub-cache.h"
10 10
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 Node* value) { 1269 Node* value) {
1270 int offset = Context::SlotOffset(slot_index); 1270 int offset = Context::SlotOffset(slot_index);
1271 return Store(MachineRepresentation::kTagged, context, IntPtrConstant(offset), 1271 return Store(MachineRepresentation::kTagged, context, IntPtrConstant(offset),
1272 value); 1272 value);
1273 } 1273 }
1274 1274
1275 Node* CodeStubAssembler::LoadNativeContext(Node* context) { 1275 Node* CodeStubAssembler::LoadNativeContext(Node* context) {
1276 return LoadContextElement(context, Context::NATIVE_CONTEXT_INDEX); 1276 return LoadContextElement(context, Context::NATIVE_CONTEXT_INDEX);
1277 } 1277 }
1278 1278
1279 Node* CodeStubAssembler::LoadModuleContext(Node* context) {
1280 Variable var_context(this, MachineRepresentation::kTaggedPointer);
1281 var_context.Bind(context);
1282
1283 Label loop_start(this, &var_context), loop_end(this);
1284 Goto(&loop_start);
1285 Bind(&loop_start);
1286 {
1287 Node* context_map = LoadMap(var_context.value());
1288 Node* is_module_context =
1289 WordEqual(context_map, LoadRoot(Heap::kModuleContextMapRootIndex));
1290 GotoIf(is_module_context, &loop_end);
1291
1292 var_context.Bind(
1293 LoadContextElement(var_context.value(), Context::PREVIOUS_INDEX));
1294 Goto(&loop_start);
1295 }
1296 Bind(&loop_end);
1297 return var_context.value();
1298 }
1299
1279 Node* CodeStubAssembler::LoadJSArrayElementsMap(ElementsKind kind, 1300 Node* CodeStubAssembler::LoadJSArrayElementsMap(ElementsKind kind,
1280 Node* native_context) { 1301 Node* native_context) {
1281 CSA_ASSERT(IsNativeContext(native_context)); 1302 CSA_ASSERT(IsNativeContext(native_context));
1282 return LoadFixedArrayElement(native_context, 1303 return LoadFixedArrayElement(native_context,
1283 IntPtrConstant(Context::ArrayMapIndex(kind))); 1304 IntPtrConstant(Context::ArrayMapIndex(kind)));
1284 } 1305 }
1285 1306
1286 Node* CodeStubAssembler::StoreHeapNumberValue(Node* object, Node* value) { 1307 Node* CodeStubAssembler::StoreHeapNumberValue(Node* object, Node* value) {
1287 return StoreObjectFieldNoWriteBarrier(object, HeapNumber::kValueOffset, value, 1308 return StoreObjectFieldNoWriteBarrier(object, HeapNumber::kValueOffset, value,
1288 MachineRepresentation::kFloat64); 1309 MachineRepresentation::kFloat64);
(...skipping 7433 matching lines...) Expand 10 before | Expand all | Expand 10 after
8722 Node* buffer_bit_field = LoadObjectField( 8743 Node* buffer_bit_field = LoadObjectField(
8723 buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32()); 8744 buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32());
8724 Node* was_neutered_mask = Int32Constant(JSArrayBuffer::WasNeutered::kMask); 8745 Node* was_neutered_mask = Int32Constant(JSArrayBuffer::WasNeutered::kMask);
8725 8746
8726 return Word32NotEqual(Word32And(buffer_bit_field, was_neutered_mask), 8747 return Word32NotEqual(Word32And(buffer_bit_field, was_neutered_mask),
8727 Int32Constant(0)); 8748 Int32Constant(0));
8728 } 8749 }
8729 8750
8730 } // namespace internal 8751 } // namespace internal
8731 } // namespace v8 8752 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698