OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2219 HInvokeFunction(HValue* context, HValue* function, int argument_count) | 2219 HInvokeFunction(HValue* context, HValue* function, int argument_count) |
2220 : HBinaryCall(context, function, argument_count) { | 2220 : HBinaryCall(context, function, argument_count) { |
2221 } | 2221 } |
2222 | 2222 |
2223 HInvokeFunction(HValue* context, | 2223 HInvokeFunction(HValue* context, |
2224 HValue* function, | 2224 HValue* function, |
2225 Handle<JSFunction> known_function, | 2225 Handle<JSFunction> known_function, |
2226 int argument_count) | 2226 int argument_count) |
2227 : HBinaryCall(context, function, argument_count), | 2227 : HBinaryCall(context, function, argument_count), |
2228 known_function_(known_function) { | 2228 known_function_(known_function) { |
2229 formal_parameter_count_ = known_function.is_null() | |
2230 ? 0 : known_function->shared()->formal_parameter_count(); | |
2229 } | 2231 } |
2230 | 2232 |
2231 virtual Representation RequiredInputRepresentation(int index) { | 2233 virtual Representation RequiredInputRepresentation(int index) { |
2232 return Representation::Tagged(); | 2234 return Representation::Tagged(); |
2233 } | 2235 } |
2234 | 2236 |
2235 HValue* context() { return first(); } | 2237 HValue* context() { return first(); } |
2236 HValue* function() { return second(); } | 2238 HValue* function() { return second(); } |
2237 Handle<JSFunction> known_function() { return known_function_; } | 2239 Handle<JSFunction> known_function() { return known_function_; } |
2240 int formal_parameter_count() const { return formal_parameter_count_; } | |
2238 | 2241 |
2239 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction) | 2242 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction) |
2240 | 2243 |
2241 private: | 2244 private: |
2242 Handle<JSFunction> known_function_; | 2245 Handle<JSFunction> known_function_; |
2246 int formal_parameter_count_; | |
2243 }; | 2247 }; |
2244 | 2248 |
2245 | 2249 |
2246 class HCallConstantFunction: public HCall<0> { | 2250 class HCallConstantFunction: public HCall<0> { |
2247 public: | 2251 public: |
2248 HCallConstantFunction(Handle<JSFunction> function, int argument_count) | 2252 HCallConstantFunction(Handle<JSFunction> function, int argument_count) |
2249 : HCall<0>(argument_count), function_(function) { } | 2253 : HCall<0>(argument_count), |
2254 function_(function), | |
2255 formal_parameter_count_(function->shared()->formal_parameter_count()) {} | |
2250 | 2256 |
2251 Handle<JSFunction> function() const { return function_; } | 2257 Handle<JSFunction> function() const { return function_; } |
2258 int formal_parameter_count() const { return formal_parameter_count_; } | |
2252 | 2259 |
2253 bool IsApplyFunction() const { | 2260 bool IsApplyFunction() const { |
2254 return function_->code() == | 2261 return function_->code() == |
2255 Isolate::Current()->builtins()->builtin(Builtins::kFunctionApply); | 2262 Isolate::Current()->builtins()->builtin(Builtins::kFunctionApply); |
2256 } | 2263 } |
2257 | 2264 |
2258 virtual void PrintDataTo(StringStream* stream); | 2265 virtual void PrintDataTo(StringStream* stream); |
2259 | 2266 |
2260 virtual Representation RequiredInputRepresentation(int index) { | 2267 virtual Representation RequiredInputRepresentation(int index) { |
2261 return Representation::None(); | 2268 return Representation::None(); |
2262 } | 2269 } |
2263 | 2270 |
2264 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction) | 2271 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction) |
2265 | 2272 |
2266 private: | 2273 private: |
2267 Handle<JSFunction> function_; | 2274 Handle<JSFunction> function_; |
2275 int formal_parameter_count_; | |
2268 }; | 2276 }; |
2269 | 2277 |
2270 | 2278 |
2271 class HCallKeyed: public HBinaryCall { | 2279 class HCallKeyed: public HBinaryCall { |
2272 public: | 2280 public: |
2273 HCallKeyed(HValue* context, HValue* key, int argument_count) | 2281 HCallKeyed(HValue* context, HValue* key, int argument_count) |
2274 : HBinaryCall(context, key, argument_count) { | 2282 : HBinaryCall(context, key, argument_count) { |
2275 } | 2283 } |
2276 | 2284 |
2277 virtual Representation RequiredInputRepresentation(int index) { | 2285 virtual Representation RequiredInputRepresentation(int index) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2342 DECLARE_CONCRETE_INSTRUCTION(CallGlobal) | 2350 DECLARE_CONCRETE_INSTRUCTION(CallGlobal) |
2343 | 2351 |
2344 private: | 2352 private: |
2345 Handle<String> name_; | 2353 Handle<String> name_; |
2346 }; | 2354 }; |
2347 | 2355 |
2348 | 2356 |
2349 class HCallKnownGlobal: public HCall<0> { | 2357 class HCallKnownGlobal: public HCall<0> { |
2350 public: | 2358 public: |
2351 HCallKnownGlobal(Handle<JSFunction> target, int argument_count) | 2359 HCallKnownGlobal(Handle<JSFunction> target, int argument_count) |
2352 : HCall<0>(argument_count), target_(target) { } | 2360 : HCall<0>(argument_count), |
2361 target_(target), | |
2362 formal_parameter_count_(target->shared()->formal_parameter_count()) { } | |
2353 | 2363 |
2354 virtual void PrintDataTo(StringStream* stream); | 2364 virtual void PrintDataTo(StringStream* stream); |
2355 | 2365 |
2356 Handle<JSFunction> target() const { return target_; } | 2366 Handle<JSFunction> target() const { return target_; } |
2367 int formal_parameter_count() const { return formal_parameter_count_; } | |
2357 | 2368 |
2358 virtual Representation RequiredInputRepresentation(int index) { | 2369 virtual Representation RequiredInputRepresentation(int index) { |
2359 return Representation::None(); | 2370 return Representation::None(); |
2360 } | 2371 } |
2361 | 2372 |
2362 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal) | 2373 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal) |
2363 | 2374 |
2364 private: | 2375 private: |
2365 Handle<JSFunction> target_; | 2376 Handle<JSFunction> target_; |
2377 int formal_parameter_count_; | |
2366 }; | 2378 }; |
2367 | 2379 |
2368 | 2380 |
2369 class HCallNew: public HBinaryCall { | 2381 class HCallNew: public HBinaryCall { |
2370 public: | 2382 public: |
2371 HCallNew(HValue* context, HValue* constructor, int argument_count) | 2383 HCallNew(HValue* context, HValue* constructor, int argument_count) |
2372 : HBinaryCall(context, constructor, argument_count) { | 2384 : HBinaryCall(context, constructor, argument_count) { |
2373 } | 2385 } |
2374 | 2386 |
2375 virtual Representation RequiredInputRepresentation(int index) { | 2387 virtual Representation RequiredInputRepresentation(int index) { |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3224 Handle<Object> optional_handle = Handle<Object>::null()); | 3236 Handle<Object> optional_handle = Handle<Object>::null()); |
3225 HConstant(Handle<Object> handle, | 3237 HConstant(Handle<Object> handle, |
3226 UniqueValueId unique_id, | 3238 UniqueValueId unique_id, |
3227 Representation r, | 3239 Representation r, |
3228 HType type, | 3240 HType type, |
3229 bool is_internalized_string, | 3241 bool is_internalized_string, |
3230 bool boolean_value); | 3242 bool boolean_value); |
3231 | 3243 |
3232 Handle<Object> handle() { | 3244 Handle<Object> handle() { |
3233 if (handle_.is_null()) { | 3245 if (handle_.is_null()) { |
3234 handle_ = FACTORY->NewNumber(double_value_, TENURED); | 3246 handle_ = isolate()->factory()->NewNumber(double_value_, TENURED); |
3235 } | 3247 } |
3248 ALLOW_HANDLE_DEREF(isolate(), "smi check"); | |
3236 ASSERT(has_int32_value_ || !handle_->IsSmi()); | 3249 ASSERT(has_int32_value_ || !handle_->IsSmi()); |
3237 return handle_; | 3250 return handle_; |
3238 } | 3251 } |
3239 | 3252 |
3240 bool IsSpecialDouble() const { | 3253 bool IsSpecialDouble() const { |
3241 return has_double_value_ && | 3254 return has_double_value_ && |
3242 (BitCast<int64_t>(double_value_) == BitCast<int64_t>(-0.0) || | 3255 (BitCast<int64_t>(double_value_) == BitCast<int64_t>(-0.0) || |
3243 FixedDoubleArray::is_the_hole_nan(double_value_) || | 3256 FixedDoubleArray::is_the_hole_nan(double_value_) || |
3244 std::isnan(double_value_)); | 3257 std::isnan(double_value_)); |
3245 } | 3258 } |
3246 | 3259 |
3247 bool ImmortalImmovable() const { | 3260 bool ImmortalImmovable() const { |
3248 if (has_int32_value_) { | 3261 if (has_int32_value_) { |
3249 return false; | 3262 return false; |
3250 } | 3263 } |
3251 if (has_double_value_) { | 3264 if (has_double_value_) { |
3252 if (IsSpecialDouble()) { | 3265 if (IsSpecialDouble()) { |
3253 return true; | 3266 return true; |
3254 } | 3267 } |
3255 return false; | 3268 return false; |
3256 } | 3269 } |
3257 | 3270 |
3258 ASSERT(!handle_.is_null()); | 3271 ASSERT(!handle_.is_null()); |
3259 HandleDereferenceGuard allow_dereference_for_immovable_check( | |
3260 isolate(), HandleDereferenceGuard::ALLOW); | |
3261 Heap* heap = isolate()->heap(); | 3272 Heap* heap = isolate()->heap(); |
3262 ASSERT(unique_id_ != UniqueValueId(heap->minus_zero_value())); | 3273 ASSERT(unique_id_ != UniqueValueId(heap->minus_zero_value())); |
3263 ASSERT(unique_id_ != UniqueValueId(heap->nan_value())); | 3274 ASSERT(unique_id_ != UniqueValueId(heap->nan_value())); |
3264 return unique_id_ == UniqueValueId(heap->undefined_value()) || | 3275 return unique_id_ == UniqueValueId(heap->undefined_value()) || |
3265 unique_id_ == UniqueValueId(heap->null_value()) || | 3276 unique_id_ == UniqueValueId(heap->null_value()) || |
3266 unique_id_ == UniqueValueId(heap->true_value()) || | 3277 unique_id_ == UniqueValueId(heap->true_value()) || |
3267 unique_id_ == UniqueValueId(heap->false_value()) || | 3278 unique_id_ == UniqueValueId(heap->false_value()) || |
3268 unique_id_ == UniqueValueId(heap->the_hole_value()) || | 3279 unique_id_ == UniqueValueId(heap->the_hole_value()) || |
3269 unique_id_ == UniqueValueId(heap->empty_string()); | 3280 unique_id_ == UniqueValueId(heap->empty_string()); |
3270 } | 3281 } |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4873 }; | 4884 }; |
4874 | 4885 |
4875 | 4886 |
4876 class HAllocateObject: public HTemplateInstruction<1> { | 4887 class HAllocateObject: public HTemplateInstruction<1> { |
4877 public: | 4888 public: |
4878 HAllocateObject(HValue* context, Handle<JSFunction> constructor) | 4889 HAllocateObject(HValue* context, Handle<JSFunction> constructor) |
4879 : constructor_(constructor) { | 4890 : constructor_(constructor) { |
4880 SetOperandAt(0, context); | 4891 SetOperandAt(0, context); |
4881 set_representation(Representation::Tagged()); | 4892 set_representation(Representation::Tagged()); |
4882 SetGVNFlag(kChangesNewSpacePromotion); | 4893 SetGVNFlag(kChangesNewSpacePromotion); |
4894 constructor_initial_map_ = constructor->has_initial_map() | |
4895 ? Handle<Map>(constructor->initial_map()) | |
4896 : Handle<Map>::null(); | |
4897 // If slack tracking finished, the instance size and property counts | |
4898 // remain unchanged so that we can allocate memory for the object. | |
4899 ASSERT(!constructor->shared()->IsInobjectSlackTrackingInProgress()); | |
mvstanton
2013/04/23 08:58:50
I like the assert but how do you know slack tracki
Yang
2013/04/23 09:19:09
I simply moved this assertion from lithium. The us
| |
4883 } | 4900 } |
4884 | 4901 |
4885 // Maximum instance size for which allocations will be inlined. | 4902 // Maximum instance size for which allocations will be inlined. |
4886 static const int kMaxSize = 64 * kPointerSize; | 4903 static const int kMaxSize = 64 * kPointerSize; |
4887 | 4904 |
4888 HValue* context() { return OperandAt(0); } | 4905 HValue* context() { return OperandAt(0); } |
4889 Handle<JSFunction> constructor() { return constructor_; } | 4906 Handle<JSFunction> constructor() { return constructor_; } |
4907 Handle<Map> constructor_initial_map() { return constructor_initial_map_; } | |
4890 | 4908 |
4891 virtual Representation RequiredInputRepresentation(int index) { | 4909 virtual Representation RequiredInputRepresentation(int index) { |
4892 return Representation::Tagged(); | 4910 return Representation::Tagged(); |
4893 } | 4911 } |
4894 virtual Handle<Map> GetMonomorphicJSObjectMap() { | 4912 virtual Handle<Map> GetMonomorphicJSObjectMap() { |
4895 ASSERT(constructor()->has_initial_map()); | 4913 ASSERT(!constructor_initial_map_.is_null()); |
4896 return Handle<Map>(constructor()->initial_map()); | 4914 return constructor_initial_map_; |
4897 } | 4915 } |
4898 virtual HType CalculateInferredType(); | 4916 virtual HType CalculateInferredType(); |
4899 | 4917 |
4900 DECLARE_CONCRETE_INSTRUCTION(AllocateObject) | 4918 DECLARE_CONCRETE_INSTRUCTION(AllocateObject) |
4901 | 4919 |
4902 private: | 4920 private: |
4903 // TODO(svenpanne) Might be safe, but leave it out until we know for sure. | 4921 // TODO(svenpanne) Might be safe, but leave it out until we know for sure. |
4904 // virtual bool IsDeletable() const { return true; } | 4922 // virtual bool IsDeletable() const { return true; } |
4905 | 4923 |
4906 Handle<JSFunction> constructor_; | 4924 Handle<JSFunction> constructor_; |
4925 Handle<Map> constructor_initial_map_; | |
4907 }; | 4926 }; |
4908 | 4927 |
4909 | 4928 |
4910 class HAllocate: public HTemplateInstruction<2> { | 4929 class HAllocate: public HTemplateInstruction<2> { |
4911 public: | 4930 public: |
4912 enum Flags { | 4931 enum Flags { |
4913 CAN_ALLOCATE_IN_NEW_SPACE = 1 << 0, | 4932 CAN_ALLOCATE_IN_NEW_SPACE = 1 << 0, |
4914 CAN_ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, | 4933 CAN_ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, |
4915 CAN_ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, | 4934 CAN_ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, |
4916 ALLOCATE_DOUBLE_ALIGNED = 1 << 3 | 4935 ALLOCATE_DOUBLE_ALIGNED = 1 << 3 |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6044 int literal_index_; | 6063 int literal_index_; |
6045 int depth_; | 6064 int depth_; |
6046 AllocationSiteMode allocation_site_mode_; | 6065 AllocationSiteMode allocation_site_mode_; |
6047 }; | 6066 }; |
6048 | 6067 |
6049 | 6068 |
6050 class HArrayLiteral: public HMaterializedLiteral<1> { | 6069 class HArrayLiteral: public HMaterializedLiteral<1> { |
6051 public: | 6070 public: |
6052 HArrayLiteral(HValue* context, | 6071 HArrayLiteral(HValue* context, |
6053 Handle<HeapObject> boilerplate_object, | 6072 Handle<HeapObject> boilerplate_object, |
6073 Handle<FixedArray> literals, | |
6054 int length, | 6074 int length, |
6055 int literal_index, | 6075 int literal_index, |
6056 int depth, | 6076 int depth, |
6057 AllocationSiteMode mode) | 6077 AllocationSiteMode mode) |
6058 : HMaterializedLiteral<1>(literal_index, depth, mode), | 6078 : HMaterializedLiteral<1>(literal_index, depth, mode), |
6059 length_(length), | 6079 length_(length), |
6060 boilerplate_object_(boilerplate_object) { | 6080 boilerplate_object_(boilerplate_object), |
6081 literals_(literals) { | |
6061 SetOperandAt(0, context); | 6082 SetOperandAt(0, context); |
6062 SetGVNFlag(kChangesNewSpacePromotion); | 6083 SetGVNFlag(kChangesNewSpacePromotion); |
6084 | |
6085 boilerplate_elements_kind_ = boilerplate_object_->IsJSObject() | |
6086 ? Handle<JSObject>::cast(boilerplate_object_)->GetElementsKind() | |
6087 : TERMINAL_FAST_ELEMENTS_KIND; | |
6088 | |
6089 is_copy_on_write_ = boilerplate_object_->IsJSObject() && | |
6090 (Handle<JSObject>::cast(boilerplate_object_)->elements()->map() == | |
6091 HEAP->fixed_cow_array_map()); | |
6063 } | 6092 } |
6064 | 6093 |
6065 HValue* context() { return OperandAt(0); } | 6094 HValue* context() { return OperandAt(0); } |
6066 ElementsKind boilerplate_elements_kind() const { | 6095 ElementsKind boilerplate_elements_kind() const { |
6067 if (!boilerplate_object_->IsJSObject()) { | 6096 return boilerplate_elements_kind_; |
6068 return TERMINAL_FAST_ELEMENTS_KIND; | |
6069 } | |
6070 return Handle<JSObject>::cast(boilerplate_object_)->GetElementsKind(); | |
6071 } | 6097 } |
6072 Handle<HeapObject> boilerplate_object() const { return boilerplate_object_; } | 6098 Handle<HeapObject> boilerplate_object() const { return boilerplate_object_; } |
6099 Handle<FixedArray> literals() const { return literals_; } | |
6073 int length() const { return length_; } | 6100 int length() const { return length_; } |
6074 bool IsCopyOnWrite() const; | 6101 bool IsCopyOnWrite() const { return is_copy_on_write_; } |
6075 | 6102 |
6076 virtual Representation RequiredInputRepresentation(int index) { | 6103 virtual Representation RequiredInputRepresentation(int index) { |
6077 return Representation::Tagged(); | 6104 return Representation::Tagged(); |
6078 } | 6105 } |
6079 virtual HType CalculateInferredType(); | 6106 virtual HType CalculateInferredType(); |
6080 | 6107 |
6081 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral) | 6108 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral) |
6082 | 6109 |
6083 private: | 6110 private: |
6084 int length_; | 6111 int length_; |
6085 Handle<HeapObject> boilerplate_object_; | 6112 Handle<HeapObject> boilerplate_object_; |
6113 Handle<FixedArray> literals_; | |
6114 ElementsKind boilerplate_elements_kind_; | |
6115 bool is_copy_on_write_; | |
6086 }; | 6116 }; |
6087 | 6117 |
6088 | 6118 |
6089 class HObjectLiteral: public HMaterializedLiteral<1> { | 6119 class HObjectLiteral: public HMaterializedLiteral<1> { |
6090 public: | 6120 public: |
6091 HObjectLiteral(HValue* context, | 6121 HObjectLiteral(HValue* context, |
6092 Handle<FixedArray> constant_properties, | 6122 Handle<FixedArray> constant_properties, |
6123 Handle<FixedArray> literals, | |
6093 bool fast_elements, | 6124 bool fast_elements, |
6094 int literal_index, | 6125 int literal_index, |
6095 int depth, | 6126 int depth, |
6096 bool has_function) | 6127 bool has_function) |
6097 : HMaterializedLiteral<1>(literal_index, depth), | 6128 : HMaterializedLiteral<1>(literal_index, depth), |
6098 constant_properties_(constant_properties), | 6129 constant_properties_(constant_properties), |
6130 constant_properties_length_(constant_properties->length()), | |
6131 literals_(literals), | |
6099 fast_elements_(fast_elements), | 6132 fast_elements_(fast_elements), |
6100 has_function_(has_function) { | 6133 has_function_(has_function) { |
6101 SetOperandAt(0, context); | 6134 SetOperandAt(0, context); |
6102 SetGVNFlag(kChangesNewSpacePromotion); | 6135 SetGVNFlag(kChangesNewSpacePromotion); |
6103 } | 6136 } |
6104 | 6137 |
6105 HValue* context() { return OperandAt(0); } | 6138 HValue* context() { return OperandAt(0); } |
6106 Handle<FixedArray> constant_properties() const { | 6139 Handle<FixedArray> constant_properties() const { |
6107 return constant_properties_; | 6140 return constant_properties_; |
6108 } | 6141 } |
6142 int constant_properties_length() const { | |
6143 return constant_properties_length_; | |
6144 } | |
6145 Handle<FixedArray> literals() const { return literals_; } | |
6109 bool fast_elements() const { return fast_elements_; } | 6146 bool fast_elements() const { return fast_elements_; } |
6110 bool has_function() const { return has_function_; } | 6147 bool has_function() const { return has_function_; } |
6111 | 6148 |
6112 virtual Representation RequiredInputRepresentation(int index) { | 6149 virtual Representation RequiredInputRepresentation(int index) { |
6113 return Representation::Tagged(); | 6150 return Representation::Tagged(); |
6114 } | 6151 } |
6115 virtual HType CalculateInferredType(); | 6152 virtual HType CalculateInferredType(); |
6116 | 6153 |
6117 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral) | 6154 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral) |
6118 | 6155 |
6119 private: | 6156 private: |
6120 Handle<FixedArray> constant_properties_; | 6157 Handle<FixedArray> constant_properties_; |
6121 bool fast_elements_; | 6158 int constant_properties_length_; |
6122 bool has_function_; | 6159 Handle<FixedArray> literals_; |
6160 bool fast_elements_ : 1; | |
6161 bool has_function_ : 1; | |
6123 }; | 6162 }; |
6124 | 6163 |
6125 | 6164 |
6126 class HRegExpLiteral: public HMaterializedLiteral<1> { | 6165 class HRegExpLiteral: public HMaterializedLiteral<1> { |
6127 public: | 6166 public: |
6128 HRegExpLiteral(HValue* context, | 6167 HRegExpLiteral(HValue* context, |
6129 Handle<FixedArray> literals, | 6168 Handle<FixedArray> literals, |
6130 Handle<String> pattern, | 6169 Handle<String> pattern, |
6131 Handle<String> flags, | 6170 Handle<String> flags, |
6132 int literal_index) | 6171 int literal_index) |
(...skipping 22 matching lines...) Expand all Loading... | |
6155 Handle<String> pattern_; | 6194 Handle<String> pattern_; |
6156 Handle<String> flags_; | 6195 Handle<String> flags_; |
6157 }; | 6196 }; |
6158 | 6197 |
6159 | 6198 |
6160 class HFunctionLiteral: public HTemplateInstruction<1> { | 6199 class HFunctionLiteral: public HTemplateInstruction<1> { |
6161 public: | 6200 public: |
6162 HFunctionLiteral(HValue* context, | 6201 HFunctionLiteral(HValue* context, |
6163 Handle<SharedFunctionInfo> shared, | 6202 Handle<SharedFunctionInfo> shared, |
6164 bool pretenure) | 6203 bool pretenure) |
6165 : shared_info_(shared), pretenure_(pretenure) { | 6204 : shared_info_(shared), |
6205 pretenure_(pretenure), | |
6206 has_no_literals_(shared->num_literals() == 0), | |
6207 is_generator_(shared->is_generator()), | |
6208 language_mode_(shared->language_mode()) { | |
6166 SetOperandAt(0, context); | 6209 SetOperandAt(0, context); |
6167 set_representation(Representation::Tagged()); | 6210 set_representation(Representation::Tagged()); |
6168 SetGVNFlag(kChangesNewSpacePromotion); | 6211 SetGVNFlag(kChangesNewSpacePromotion); |
6169 } | 6212 } |
6170 | 6213 |
6171 HValue* context() { return OperandAt(0); } | 6214 HValue* context() { return OperandAt(0); } |
6172 | 6215 |
6173 virtual Representation RequiredInputRepresentation(int index) { | 6216 virtual Representation RequiredInputRepresentation(int index) { |
6174 return Representation::Tagged(); | 6217 return Representation::Tagged(); |
6175 } | 6218 } |
6176 virtual HType CalculateInferredType(); | 6219 virtual HType CalculateInferredType(); |
6177 | 6220 |
6178 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) | 6221 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) |
6179 | 6222 |
6180 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 6223 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
6181 bool pretenure() const { return pretenure_; } | 6224 bool pretenure() const { return pretenure_; } |
6225 bool has_no_literals() const { return has_no_literals_; } | |
6226 bool is_generator() const { return is_generator_; } | |
6227 LanguageMode language_mode() const { return language_mode_; } | |
6182 | 6228 |
6183 private: | 6229 private: |
6184 virtual bool IsDeletable() const { return true; } | 6230 virtual bool IsDeletable() const { return true; } |
6185 | 6231 |
6186 Handle<SharedFunctionInfo> shared_info_; | 6232 Handle<SharedFunctionInfo> shared_info_; |
6187 bool pretenure_; | 6233 bool pretenure_ : 1; |
6234 bool has_no_literals_ : 1; | |
6235 bool is_generator_ : 1; | |
6236 LanguageMode language_mode_; | |
6188 }; | 6237 }; |
6189 | 6238 |
6190 | 6239 |
6191 class HTypeof: public HTemplateInstruction<2> { | 6240 class HTypeof: public HTemplateInstruction<2> { |
6192 public: | 6241 public: |
6193 explicit HTypeof(HValue* context, HValue* value) { | 6242 explicit HTypeof(HValue* context, HValue* value) { |
6194 SetOperandAt(0, context); | 6243 SetOperandAt(0, context); |
6195 SetOperandAt(1, value); | 6244 SetOperandAt(1, value); |
6196 set_representation(Representation::Tagged()); | 6245 set_representation(Representation::Tagged()); |
6197 } | 6246 } |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6491 virtual bool IsDeletable() const { return true; } | 6540 virtual bool IsDeletable() const { return true; } |
6492 }; | 6541 }; |
6493 | 6542 |
6494 | 6543 |
6495 #undef DECLARE_INSTRUCTION | 6544 #undef DECLARE_INSTRUCTION |
6496 #undef DECLARE_CONCRETE_INSTRUCTION | 6545 #undef DECLARE_CONCRETE_INSTRUCTION |
6497 | 6546 |
6498 } } // namespace v8::internal | 6547 } } // namespace v8::internal |
6499 | 6548 |
6500 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6549 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |