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

Unified Diff: src/mips/code-stubs-mips.cc

Issue 1250733005: SIMD.js Add the other SIMD Phase 1 types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make _IsSimdObject an assembly intrinsic in fullcodegen. Created 5 years, 5 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
Index: src/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index 5ebb70ed8bc6b41a73196ceb006bf8174733e854..816d5ea77019047a88375b6fc338e57d728f6e63 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -291,12 +291,15 @@ static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow,
// Smis. If it's not a heap number, then return equal.
__ GetObjectType(a0, t4, t4);
if (cc == less || cc == greater) {
+ Label not_simd;
// Call runtime on identical JSObjects.
__ Branch(slow, greater, t4, Operand(FIRST_SPEC_OBJECT_TYPE));
// Call runtime on identical symbols since we need to throw a TypeError.
__ Branch(slow, eq, t4, Operand(SYMBOL_TYPE));
// Call runtime on identical SIMD values since we must throw a TypeError.
- __ Branch(slow, eq, t4, Operand(FLOAT32X4_TYPE));
+ __ Branch(&not_simd, lt, t4, Operand(FIRST_SIMD_VALUE_TYPE));
+ __ Branch(slow, le, t4, Operand(LAST_SIMD_VALUE_TYPE));
+ __ bind(&not_simd);
if (is_strong(strength)) {
// Call the runtime on anything that is converted in the semantics, since
// we need to throw a TypeError. Smis have already been ruled out.
@@ -305,6 +308,7 @@ static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow,
__ Branch(slow, ne, t4, Operand(zero_reg));
}
} else {
+ Label not_simd;
__ Branch(&heap_number, eq, t4, Operand(HEAP_NUMBER_TYPE));
// Comparing JS objects with <=, >= is complicated.
if (cc != eq) {
@@ -312,7 +316,9 @@ static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow,
// Call runtime on identical symbols since we need to throw a TypeError.
__ Branch(slow, eq, t4, Operand(SYMBOL_TYPE));
// Call runtime on identical SIMD values since we must throw a TypeError.
- __ Branch(slow, eq, t4, Operand(FLOAT32X4_TYPE));
+ __ Branch(&not_simd, lt, t4, Operand(FIRST_SIMD_VALUE_TYPE));
+ __ Branch(slow, le, t4, Operand(LAST_SIMD_VALUE_TYPE));
+ __ bind(&not_simd);
if (is_strong(strength)) {
// Call the runtime on anything that is converted in the semantics,
// since we need to throw a TypeError. Smis and heap numbers have
@@ -5273,6 +5279,7 @@ void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = cp;
Register slot_reg = a2;
+ Register name_reg = a3;
Register result_reg = v0;
Label slow_case;
@@ -5285,7 +5292,8 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) {
// Load the PropertyCell value at the specified slot.
__ sll(at, slot_reg, kPointerSizeLog2);
__ Addu(at, at, Operand(context_reg));
- __ lw(result_reg, ContextOperand(at, 0));
+ __ Addu(at, at, Context::SlotOffset(0));
+ __ lw(result_reg, MemOperand(at));
__ lw(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset));
// Check that value is not the_hole.
@@ -5296,23 +5304,24 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) {
// Fallback to the runtime.
__ bind(&slow_case);
__ SmiTag(slot_reg);
- __ Push(slot_reg);
- __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 1, 1);
+ __ Push(slot_reg, name_reg);
+ __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1);
}
void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = cp;
Register slot_reg = a2;
+ Register name_reg = a3;
Register value_reg = a0;
Register cell_reg = t0;
- Register cell_value_reg = t1;
- Register cell_details_reg = t2;
+ Register cell_details_reg = t1;
Label fast_heapobject_case, fast_smi_case, slow_case;
if (FLAG_debug_code) {
__ LoadRoot(at, Heap::kTheHoleValueRootIndex);
__ Check(ne, kUnexpectedValue, value_reg, Operand(at));
+ __ AssertName(name_reg);
}
// Go up context chain to the script context.
@@ -5324,7 +5333,8 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
// Load the PropertyCell at the specified slot.
__ sll(at, slot_reg, kPointerSizeLog2);
__ Addu(at, at, Operand(context_reg));
- __ lw(cell_reg, ContextOperand(at, 0));
+ __ Addu(at, at, Context::SlotOffset(0));
+ __ lw(cell_reg, MemOperand(at));
// Load PropertyDetails for the cell (actually only the cell_type and kind).
__ lw(cell_details_reg,
@@ -5332,8 +5342,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
__ SmiUntag(cell_details_reg);
__ And(cell_details_reg, cell_details_reg,
PropertyDetails::PropertyCellTypeField::kMask |
- PropertyDetails::KindField::kMask |
- PropertyDetails::kAttributesReadOnlyMask);
+ PropertyDetails::KindField::kMask);
// Check if PropertyCell holds mutable data.
Label not_mutable_data;
@@ -5348,18 +5357,15 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
cell_details_reg, kRAHasNotBeenSaved, kDontSaveFPRegs,
EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
// RecordWriteField clobbers the value register, so we need to reload.
- __ Ret(USE_DELAY_SLOT);
__ lw(value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset));
+ __ Ret();
__ bind(&not_mutable_data);
// Check if PropertyCell value matches the new value (relevant for Constant,
// ConstantType and Undefined cells).
Label not_same_value;
- __ lw(cell_value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset));
- __ Branch(&not_same_value, ne, value_reg, Operand(cell_value_reg));
- // Make sure the PropertyCell is not marked READ_ONLY.
- __ And(at, cell_details_reg, PropertyDetails::kAttributesReadOnlyMask);
- __ Branch(&slow_case, ne, at, Operand(zero_reg));
+ __ lw(at, FieldMemOperand(cell_reg, PropertyCell::kValueOffset));
+ __ Branch(&not_same_value, ne, value_reg, Operand(at));
if (FLAG_debug_code) {
Label done;
// This can only be true for Constant, ConstantType and Undefined cells,
@@ -5381,8 +5387,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
__ Ret();
__ bind(&not_same_value);
- // Check if PropertyCell contains data with constant type (and is not
- // READ_ONLY).
+ // Check if PropertyCell contains data with constant type.
__ Branch(&slow_case, ne, cell_details_reg,
Operand(PropertyDetails::PropertyCellTypeField::encode(
PropertyCellType::kConstantType) |
@@ -5391,6 +5396,8 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
// Now either both old and new values must be SMIs or both must be heap
// objects with same map.
Label value_is_heap_object;
+ Register cell_value_reg = cell_details_reg;
+ __ lw(cell_value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset));
__ JumpIfNotSmi(value_reg, &value_is_heap_object);
__ JumpIfNotSmi(cell_value_reg, &slow_case);
// Old and new values are SMIs, no need for a write barrier here.
@@ -5408,11 +5415,11 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
// Fallback to the runtime.
__ bind(&slow_case);
__ SmiTag(slot_reg);
- __ Push(slot_reg, value_reg);
+ __ Push(slot_reg, name_reg, value_reg);
__ TailCallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 2, 1);
+ 3, 1);
}
« src/macros.py ('K') | « src/messages.js ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698