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

Unified Diff: src/property-details-inl.h

Issue 196353004: Fixed handling of polymorphic array accesses with constant index (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 6 years, 9 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 | « src/property-details.h ('k') | test/mjsunit/regress/regress-351319.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/property-details-inl.h
diff --git a/test/cctest/print-extension.h b/src/property-details-inl.h
similarity index 77%
copy from test/cctest/print-extension.h
copy to src/property-details-inl.h
index 7fe9226f7b48da3021496f63389eb71bb2971396..98eb1cf58e606c6d755210c91f18c21e51a8bfaa 100644
--- a/test/cctest/print-extension.h
+++ b/src/property-details-inl.h
@@ -25,23 +25,27 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_TEST_CCTEST_PRINT_EXTENSION_H_
-#define V8_TEST_CCTEST_PRINT_EXTENSION_H_
+#ifndef V8_PROPERTY_DETAILS_INL_H_
+#define V8_PROPERTY_DETAILS_INL_H_
-#include "v8.h"
+#include "objects.h"
+#include "property-details.h"
+#include "v8conversions.h"
namespace v8 {
namespace internal {
-class PrintExtension : public v8::Extension {
- public:
- PrintExtension() : v8::Extension("v8/print", "native function print();") { }
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> name);
- static void Print(const v8::FunctionCallbackInfo<v8::Value>& args);
-};
+inline bool Representation::CanContainDouble(double value) {
+ if (IsDouble() || is_more_general_than(Representation::Double())) {
+ return true;
+ }
+ if (IsInt32Double(value)) {
+ if (IsInteger32()) return true;
+ if (IsSmi()) return Smi::IsValid(static_cast<int32_t>(value));
+ }
+ return false;
+}
} } // namespace v8::internal
-#endif
+#endif // V8_PROPERTY_DETAILS_INL_H_
« no previous file with comments | « src/property-details.h ('k') | test/mjsunit/regress/regress-351319.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698