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

Unified Diff: src/code-stubs.cc

Issue 2319243002: [stubs] Fixing loads/stores from arrays by int32 offsets/indices. Step 3. (Closed)
Patch Set: Fixing redness Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stub-assembler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 2f99e15d0d1606499bae7d1fa5f0a566494c8103..a79c25a0bb9cb60e5faf4a06015074faf88e4595 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -2601,7 +2601,7 @@ void ToObjectStub::GenerateAssembly(CodeStubAssembler* assembler) const {
Node* context = assembler->Parameter(Descriptor::kContext);
Variable constructor_function_index_var(assembler,
- MachineRepresentation::kWord32);
+ MachineType::PointerRepresentation());
assembler->Branch(assembler->WordIsSmi(object), &if_number, &if_notsmi);
@@ -2618,26 +2618,25 @@ void ToObjectStub::GenerateAssembly(CodeStubAssembler* assembler) const {
instance_type, assembler->Int32Constant(FIRST_JS_RECEIVER_TYPE)),
&if_jsreceiver);
- Node* constructor_function_index = assembler->LoadObjectField(
- map, Map::kInObjectPropertiesOrConstructorFunctionIndexOffset,
- MachineType::Uint8());
- assembler->GotoIf(
- assembler->Word32Equal(
- constructor_function_index,
- assembler->Int32Constant(Map::kNoConstructorFunctionIndex)),
- &if_noconstructor);
+ Node* constructor_function_index =
+ assembler->LoadMapConstructorFunctionIndex(map);
+ assembler->GotoIf(assembler->WordEqual(constructor_function_index,
+ assembler->IntPtrConstant(
+ Map::kNoConstructorFunctionIndex)),
+ &if_noconstructor);
constructor_function_index_var.Bind(constructor_function_index);
assembler->Goto(&if_wrapjsvalue);
assembler->Bind(&if_number);
constructor_function_index_var.Bind(
- assembler->Int32Constant(Context::NUMBER_FUNCTION_INDEX));
+ assembler->IntPtrConstant(Context::NUMBER_FUNCTION_INDEX));
assembler->Goto(&if_wrapjsvalue);
assembler->Bind(&if_wrapjsvalue);
Node* native_context = assembler->LoadNativeContext(context);
Node* constructor = assembler->LoadFixedArrayElement(
- native_context, constructor_function_index_var.value());
+ native_context, constructor_function_index_var.value(), 0,
+ CodeStubAssembler::INTPTR_PARAMETERS);
Node* initial_map = assembler->LoadObjectField(
constructor, JSFunction::kPrototypeOrInitialMapOffset);
Node* js_value = assembler->Allocate(JSValue::kSize);
@@ -4427,9 +4426,10 @@ void LoadApiGetterStub::GenerateAssembly(CodeStubAssembler* assembler) const {
Node* holder = receiver;
Node* map = assembler->LoadMap(receiver);
Node* descriptors = assembler->LoadMapDescriptors(map);
- Node* offset =
- assembler->Int32Constant(DescriptorArray::ToValueIndex(index()));
- Node* callback = assembler->LoadFixedArrayElement(descriptors, offset);
+ Node* value_index =
+ assembler->IntPtrConstant(DescriptorArray::ToValueIndex(index()));
+ Node* callback = assembler->LoadFixedArrayElement(
+ descriptors, value_index, 0, CodeStubAssembler::INTPTR_PARAMETERS);
assembler->TailCallStub(CodeFactory::ApiGetter(isolate()), context, receiver,
holder, callback);
}
@@ -5193,7 +5193,7 @@ compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler,
Label if_normal(assembler), if_generator(assembler), if_async(assembler),
if_class_constructor(assembler), if_function_without_prototype(assembler),
load_map(assembler);
- Variable map_index(assembler, MachineRepresentation::kTagged);
+ Variable map_index(assembler, MachineType::PointerRepresentation());
Node* is_not_normal = assembler->Word32And(
compiler_hints,
@@ -5228,8 +5228,9 @@ compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler,
assembler->Bind(&if_normal);
{
map_index.Bind(assembler->Select(
- is_strict, assembler->Int32Constant(Context::STRICT_FUNCTION_MAP_INDEX),
- assembler->Int32Constant(Context::SLOPPY_FUNCTION_MAP_INDEX)));
+ is_strict,
+ assembler->IntPtrConstant(Context::STRICT_FUNCTION_MAP_INDEX),
+ assembler->IntPtrConstant(Context::SLOPPY_FUNCTION_MAP_INDEX)));
assembler->Goto(&load_map);
}
@@ -5237,8 +5238,8 @@ compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler,
{
map_index.Bind(assembler->Select(
is_strict,
- assembler->Int32Constant(Context::STRICT_GENERATOR_FUNCTION_MAP_INDEX),
- assembler->Int32Constant(
+ assembler->IntPtrConstant(Context::STRICT_GENERATOR_FUNCTION_MAP_INDEX),
+ assembler->IntPtrConstant(
Context::SLOPPY_GENERATOR_FUNCTION_MAP_INDEX)));
assembler->Goto(&load_map);
}
@@ -5247,21 +5248,21 @@ compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler,
{
map_index.Bind(assembler->Select(
is_strict,
- assembler->Int32Constant(Context::STRICT_ASYNC_FUNCTION_MAP_INDEX),
- assembler->Int32Constant(Context::SLOPPY_ASYNC_FUNCTION_MAP_INDEX)));
+ assembler->IntPtrConstant(Context::STRICT_ASYNC_FUNCTION_MAP_INDEX),
+ assembler->IntPtrConstant(Context::SLOPPY_ASYNC_FUNCTION_MAP_INDEX)));
assembler->Goto(&load_map);
}
assembler->Bind(&if_class_constructor);
{
map_index.Bind(
- assembler->Int32Constant(Context::STRICT_FUNCTION_MAP_INDEX));
+ assembler->IntPtrConstant(Context::STRICT_FUNCTION_MAP_INDEX));
assembler->Goto(&load_map);
}
assembler->Bind(&if_function_without_prototype);
{
- map_index.Bind(assembler->Int32Constant(
+ map_index.Bind(assembler->IntPtrConstant(
Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX));
assembler->Goto(&load_map);
}
@@ -5272,7 +5273,8 @@ compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler,
// as the map of the allocated object.
Node* native_context = assembler->LoadNativeContext(context);
Node* map_slot_value =
- assembler->LoadFixedArrayElement(native_context, map_index.value());
+ assembler->LoadFixedArrayElement(native_context, map_index.value(), 0,
+ CodeStubAssembler::INTPTR_PARAMETERS);
assembler->StoreMapNoWriteBarrier(result, map_slot_value);
// Initialize the rest of the function.
« no previous file with comments | « src/code-stub-assembler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698