Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index 591390231526124567d494905432b3a08cafd8b5..27fd055d43443824b8f0ee408d32667bc0b324c4 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -7920,6 +7920,52 @@ const HOptimizedGraphBuilder::InlineFunctionGenerator |
| #undef INLINE_FUNCTION_GENERATOR_ADDRESS |
| +void HOptimizedGraphBuilder::VisitDataViewInitialize( |
| + CallRuntime* expr) { |
| + ZoneList<Expression*>* arguments = expr->arguments(); |
| + |
| + NoObservableSideEffectsScope scope(this); |
| + ASSERT(arguments->length()== 4); |
| + CHECK_ALIVE(VisitForValue(arguments->at(0))); |
| + HValue* obj = Pop(); |
| + |
| + CHECK_ALIVE(VisitForValue(arguments->at(1))); |
| + HValue* buffer = Pop(); |
| + |
| + CHECK_ALIVE(VisitForValue(arguments->at(2))); |
| + HValue* byte_offset = Pop(); |
| + |
| + CHECK_ALIVE(VisitForValue(arguments->at(3))); |
| + HValue* byte_length = Pop(); |
| + |
| + for (int offset = JSDataView::kSize; |
| + offset < JSDataView::kSizeWithInternalFields; |
| + offset += kPointerSize) { |
| + Add<HStoreNamedField>(obj, |
| + HObjectAccess::ForJSObjectOffset(offset), |
| + Add<HConstant>(static_cast<int32_t>(0))); |
| + } |
| + |
| + Add<HStoreNamedField>(obj, |
| + HObjectAccess::ForJSObjectOffset(JSDataView::kBufferOffset), buffer); |
| + Add<HStoreNamedField>(obj, |
| + HObjectAccess::ForJSObjectOffset(JSDataView::kByteOffsetOffset), |
| + byte_offset); |
|
Benedikt Meurer
2013/11/18 08:02:31
byte_offset should be a SMI, so you should pass Re
Dmitry Lomov (no reviews)
2013/11/18 08:46:47
Byte offset is not neccessarily a smi here. Ditto
|
| + Add<HStoreNamedField>(obj, |
| + HObjectAccess::ForJSObjectOffset(JSDataView::kByteLengthOffset), |
|
Benedikt Meurer
2013/11/18 08:02:31
byte_length is a SMI, so you should pass Represent
|
| + byte_length); |
| + |
| + Add<HStoreNamedField>(obj, |
| + HObjectAccess::ForJSObjectOffset(JSDataView::kWeakNextOffset), |
| + Add<HLoadNamedField>(buffer, |
| + HObjectAccess::ForJSObjectOffset( |
| + JSArrayBuffer::kWeakFirstViewOffset))); |
| + Add<HStoreNamedField>(buffer, |
| + HObjectAccess::ForJSObjectOffset(JSArrayBuffer::kWeakFirstViewOffset), |
| + obj); |
| +} |
| + |
| + |
| void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) { |
| ASSERT(!HasStackOverflow()); |
| ASSERT(current_block() != NULL); |
| @@ -7930,6 +7976,11 @@ void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) { |
| const Runtime::Function* function = expr->function(); |
| ASSERT(function != NULL); |
| + |
| + if (function->function_id == Runtime::kDataViewInitialize) { |
| + return VisitDataViewInitialize(expr); |
| + } |
| + |
| if (function->intrinsic_type == Runtime::INLINE) { |
| ASSERT(expr->name()->length() > 0); |
| ASSERT(expr->name()->Get(0) == '_'); |