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

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

Issue 1293533003: [simd.js] Macro-ize more SIMD code (1). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index b1e517bf4f0ee135a613a54e97a5f3a6d7bfa043..81304e5002a1fe649e24f294b4d31916ccadddc9 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -380,78 +380,32 @@ HValue* CodeStubGraphBuilder<TypeofStub>::BuildCodeStub() {
{ Push(Add<HConstant>(factory->function_string())); }
is_function.Else();
{
- IfBuilder is_float32x4(this);
- is_float32x4.If<HCompareObjectEqAndBranch>(
- map, Add<HConstant>(factory->float32x4_map()));
- is_float32x4.Then();
- { Push(Add<HConstant>(factory->float32x4_string())); }
- is_float32x4.Else();
+#define SIMD128_BUILDER_OPEN(TYPE, Type, type, lane_count, lane_type) \
+ IfBuilder is_##type(this); \
+ is_##type.If<HCompareObjectEqAndBranch>( \
+ map, Add<HConstant>(factory->type##_map())); \
+ is_##type.Then(); \
+ { Push(Add<HConstant>(factory->type##_string())); } \
+ is_##type.Else(); {
bbudge 2015/08/17 11:58:43 I had to put the opening brace on this line to app
+ SIMD128_TYPES(SIMD128_BUILDER_OPEN)
+#undef SIMD128_BUILDER_OPEN
+ // Is it an undetectable object?
+ IfBuilder is_undetectable(this);
+ is_undetectable.If<HIsUndetectableAndBranch>(object);
+ is_undetectable.Then();
{
- IfBuilder is_int32x4(this);
- is_int32x4.If<HCompareObjectEqAndBranch>(
- map, Add<HConstant>(factory->int32x4_map()));
- is_int32x4.Then();
- { Push(Add<HConstant>(factory->int32x4_string())); }
- is_int32x4.Else();
- {
- IfBuilder is_bool32x4(this);
- is_bool32x4.If<HCompareObjectEqAndBranch>(
- map, Add<HConstant>(factory->bool32x4_map()));
- is_bool32x4.Then();
- { Push(Add<HConstant>(factory->bool32x4_string())); }
- is_bool32x4.Else();
- {
- IfBuilder is_int16x8(this);
- is_int16x8.If<HCompareObjectEqAndBranch>(
- map, Add<HConstant>(factory->int16x8_map()));
- is_int16x8.Then();
- { Push(Add<HConstant>(factory->int16x8_string())); }
- is_int16x8.Else();
- {
- IfBuilder is_bool16x8(this);
- is_bool16x8.If<HCompareObjectEqAndBranch>(
- map, Add<HConstant>(factory->bool16x8_map()));
- is_bool16x8.Then();
- { Push(Add<HConstant>(factory->bool16x8_string())); }
- is_bool16x8.Else();
- {
- IfBuilder is_int8x16(this);
- is_int8x16.If<HCompareObjectEqAndBranch>(
- map, Add<HConstant>(factory->int8x16_map()));
- is_int8x16.Then();
- { Push(Add<HConstant>(factory->int8x16_string())); }
- is_int8x16.Else();
- {
- IfBuilder is_bool8x16(this);
- is_bool8x16.If<HCompareObjectEqAndBranch>(
- map, Add<HConstant>(factory->bool8x16_map()));
- is_bool8x16.Then();
- { Push(Add<HConstant>(factory->bool8x16_string())); }
- is_bool8x16.Else();
- {
- // Is it an undetectable object?
- IfBuilder is_undetectable(this);
- is_undetectable.If<HIsUndetectableAndBranch>(
- object);
- is_undetectable.Then();
- {
- // typeof an undetectable object is 'undefined'.
- Push(Add<HConstant>(factory->undefined_string()));
bbudge 2015/08/17 13:03:57 I didn't notice before but I inadvertently changed
bbudge 2015/08/17 13:05:54 Ugh, never mind, I was confused reading the diff.
- }
- is_undetectable.Else();
- {
- // For any kind of object not handled above, the
- // spec rule for host objects gives that it is
- // okay to return "object".
- Push(object_string);
- }
- }
- }
- }
- }
- }
- }
+ // typeof an undetectable object is 'undefined'.
+ Push(Add<HConstant>(factory->undefined_string()));
}
+ is_undetectable.Else();
+ {
+ // For any kind of object not handled above, the spec rule for
+ // host objects gives that it is okay to return "object".
+ Push(object_string);
+ }
+#define SIMD128_BUILDER_CLOSE(TYPE, Type, type, lane_count, lane_type) }
+ SIMD128_TYPES(SIMD128_BUILDER_CLOSE)
+#undef SIMD128_BUILDER_CLOSE
}
is_function.End();
}
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698