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 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3280 HValue* context, | 3280 HValue* context, |
3281 int32_t value, | 3281 int32_t value, |
3282 Representation representation, | 3282 Representation representation, |
3283 HInstruction* instruction) { | 3283 HInstruction* instruction) { |
3284 HConstant* new_constant = | 3284 HConstant* new_constant = |
3285 HConstant::New(zone, context, value, representation); | 3285 HConstant::New(zone, context, value, representation); |
3286 new_constant->InsertBefore(instruction); | 3286 new_constant->InsertBefore(instruction); |
3287 return new_constant; | 3287 return new_constant; |
3288 } | 3288 } |
3289 | 3289 |
| 3290 static HConstant* CreateAndInsertBefore(Zone* zone, |
| 3291 Unique<Object> unique, |
| 3292 bool is_not_in_new_space, |
| 3293 HInstruction* instruction) { |
| 3294 HConstant* new_constant = new(zone) HConstant(unique, |
| 3295 Representation::Tagged(), HType::Tagged(), false, is_not_in_new_space, |
| 3296 false, false); |
| 3297 new_constant->InsertBefore(instruction); |
| 3298 return new_constant; |
| 3299 } |
| 3300 |
3290 Handle<Object> handle(Isolate* isolate) { | 3301 Handle<Object> handle(Isolate* isolate) { |
3291 if (object_.handle().is_null()) { | 3302 if (object_.handle().is_null()) { |
3292 // Default arguments to is_not_in_new_space depend on this heap number | 3303 // Default arguments to is_not_in_new_space depend on this heap number |
3293 // to be tenured so that it's guaranteed not to be located in new space. | 3304 // to be tenured so that it's guaranteed not to be located in new space. |
3294 object_ = Unique<Object>::CreateUninitialized( | 3305 object_ = Unique<Object>::CreateUninitialized( |
3295 isolate->factory()->NewNumber(double_value_, TENURED)); | 3306 isolate->factory()->NewNumber(double_value_, TENURED)); |
3296 } | 3307 } |
3297 AllowDeferredHandleDereference smi_check; | 3308 AllowDeferredHandleDereference smi_check; |
3298 ASSERT(has_int32_value_ || !object_.handle()->IsSmi()); | 3309 ASSERT(has_int32_value_ || !object_.handle()->IsSmi()); |
3299 return object_.handle(); | 3310 return object_.handle(); |
(...skipping 3736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7036 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7047 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7037 }; | 7048 }; |
7038 | 7049 |
7039 | 7050 |
7040 #undef DECLARE_INSTRUCTION | 7051 #undef DECLARE_INSTRUCTION |
7041 #undef DECLARE_CONCRETE_INSTRUCTION | 7052 #undef DECLARE_CONCRETE_INSTRUCTION |
7042 | 7053 |
7043 } } // namespace v8::internal | 7054 } } // namespace v8::internal |
7044 | 7055 |
7045 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7056 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |