Reviewers: rossberg,

Description:
Version 4.3.61.23 (cherry-pick)

Fix smi scanning

BUG=chromium:483176
LOG=N
[email protected]

Please review this at https://codereview.chromium.org/1149643003/

Base URL: https://chromium.googlesource.com/v8/[email protected]

Affected files (+7, -9 lines):
  M include/v8-version.h
  M src/scanner.h
  M src/scanner.cc
  A + test/mjsunit/regress/regress-smi-scanning.js


Index: include/v8-version.h
diff --git a/include/v8-version.h b/include/v8-version.h
index dab02d8a7f0e6cf7f3adf159627b2036e63ea7b6..97b4b6c29d5f62462501e51e224eac608030a294 100644
--- a/include/v8-version.h
+++ b/include/v8-version.h
@@ -11,7 +11,7 @@
 #define V8_MAJOR_VERSION 4
 #define V8_MINOR_VERSION 3
 #define V8_BUILD_NUMBER 61
-#define V8_PATCH_LEVEL 22
+#define V8_PATCH_LEVEL 23

 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index a40688f52b8a54ca500a868452faafcdd88a0650..e90ebc6518e95f3abc70288a9678281c66d860f7 100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -1007,7 +1007,7 @@ Token::Value Scanner::ScanNumber(bool seen_period) {

         if (next_.literal_chars->one_byte_literal().length() <= 10 &&
value <= Smi::kMaxValue && c0_ != '.' && c0_ != 'e' && c0_ != 'E') {
-          smi_value_ = static_cast<int>(value);
+          next_.smi_value_ = static_cast<int>(value);
           literal.Complete();
           HandleLeadSurrogate();

Index: src/scanner.h
diff --git a/src/scanner.h b/src/scanner.h
index 804082562e15605e80e7ef90622398a57a3ecd35..61deb743a297222d8495fd451489fa75d1fc1856 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -436,7 +436,7 @@ class Scanner {
   void clear_octal_position() { octal_pos_ = Location::invalid(); }

   // Returns the value of the last smi that was scanned.
-  int smi_value() const { return smi_value_; }
+  int smi_value() const { return current_.smi_value_; }

   // Seek forward to the given position.  This operation does not
   // work in general, for instance when there are pushed back
@@ -497,6 +497,7 @@ class Scanner {
     Location location;
     LiteralBuffer* literal_chars;
     LiteralBuffer* raw_literal_chars;
+    int smi_value_;
   };

   static const int kCharacterLookaheadBufferSize = 1;
@@ -724,9 +725,6 @@ class Scanner {
   // Start position of the octal literal last scanned.
   Location octal_pos_;

-  // Value of the last smi that was scanned.
-  int smi_value_;
-
   // One Unicode character look-ahead; c0_ < 0 at the end of the input.
   uc32 c0_;

Index: test/mjsunit/regress/regress-smi-scanning.js
diff --git a/test/message/import-eval.js b/test/mjsunit/regress/regress-smi-scanning.js
similarity index 80%
copy from test/message/import-eval.js
copy to test/mjsunit/regress/regress-smi-scanning.js
index 8ab35baef672a45d6a449fd328941dc4ff9a00eb..56cf9f9a2e60dde53b9be5852d571c6d9cd3a4ca 100644
--- a/test/message/import-eval.js
+++ b/test/mjsunit/regress/regress-smi-scanning.js
@@ -1,7 +1,7 @@
 // Copyright 2015 the V8 project authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-//
-// MODULE

-import { eval } from "mod";
+x = 2
+3;
+assertEquals(2, x);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to