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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 680063004: [turbofan] Minor cleanups to lowering of typed array loads/stores. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix win64 Created 6 years, 2 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/compiler/node-matchers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index fb510e07ce941efcc831a2e82de599d652e7abc4..3407840ae9f288951cc24957415ff4914097e0cd 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -565,15 +565,13 @@ Reduction JSTypedLowering::ReduceJSLoadProperty(Node* node) {
Handle<JSTypedArray>::cast(base_type->AsConstant()->Value());
if (IsExternalArrayElementsKind(array->map()->elements_kind())) {
ExternalArrayType type = array->type();
- uint32_t byte_length;
- if (array->byte_length()->ToUint32(&byte_length) &&
- byte_length <= static_cast<uint32_t>(kMaxInt)) {
+ double byte_length = array->byte_length()->Number();
+ if (byte_length <= kMaxInt) {
Handle<ExternalArray> elements =
Handle<ExternalArray>::cast(handle(array->elements()));
Node* pointer = jsgraph()->IntPtrConstant(
bit_cast<intptr_t>(elements->external_pointer()));
- Node* length = jsgraph()->Uint32Constant(
- static_cast<uint32_t>(byte_length / array->element_size()));
+ Node* length = jsgraph()->Constant(byte_length / array->element_size());
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
Node* load = graph()->NewNode(
@@ -603,15 +601,13 @@ Reduction JSTypedLowering::ReduceJSStoreProperty(Node* node) {
Handle<JSTypedArray>::cast(base_type->AsConstant()->Value());
if (IsExternalArrayElementsKind(array->map()->elements_kind())) {
ExternalArrayType type = array->type();
- uint32_t byte_length;
- if (array->byte_length()->ToUint32(&byte_length) &&
- byte_length <= static_cast<uint32_t>(kMaxInt)) {
+ double byte_length = array->byte_length()->Number();
+ if (byte_length <= kMaxInt) {
Handle<ExternalArray> elements =
Handle<ExternalArray>::cast(handle(array->elements()));
Node* pointer = jsgraph()->IntPtrConstant(
bit_cast<intptr_t>(elements->external_pointer()));
- Node* length = jsgraph()->Uint32Constant(
- static_cast<uint32_t>(byte_length / array->element_size()));
+ Node* length = jsgraph()->Constant(byte_length / array->element_size());
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
Node* store = graph()->NewNode(
« no previous file with comments | « no previous file | src/compiler/node-matchers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698