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

Unified Diff: src/x64/macro-assembler-x64.cc

Issue 209048: Handle array construction in native code (x64 version) (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
===================================================================
--- src/x64/macro-assembler-x64.cc (revision 2959)
+++ src/x64/macro-assembler-x64.cc (working copy)
@@ -519,6 +519,18 @@
}
+void MacroAssembler::JumpIfSmiGreaterEqualsConstant(Register src,
+ int constant,
+ Label* on_greater_equals) {
+ if (Smi::IsValid(constant)) {
+ Condition are_greater_equal = CheckSmiGreaterEqualsConstant(src, constant);
+ j(are_greater_equal, on_greater_equals);
+ } else if (constant < Smi::kMinValue){
+ jmp(on_greater_equals);
+ }
+}
+
+
void MacroAssembler::JumpIfNotValidSmiValue(Register src, Label* on_invalid) {
Condition is_valid = CheckInteger32ValidSmiValue(src);
j(ReverseCondition(is_valid), on_invalid);
@@ -602,6 +614,22 @@
}
+Condition MacroAssembler::CheckSmiGreaterEqualsConstant(Register src,
+ int constant) {
+ if (constant == 0) {
+ testl(src, Immediate(static_cast<uint32_t>(0x80000000u)));
+ return positive;
+ }
+ if (Smi::IsValid(constant)) {
+ cmpl(src, Immediate(Smi::FromInt(constant)));
+ return greater_equal;
+ }
+ // Can't be equal.
+ UNREACHABLE();
+ return no_condition;
+}
+
+
Condition MacroAssembler::CheckInteger32ValidSmiValue(Register src) {
// A 32-bit integer value can be converted to a smi if it is in the
// range [-2^30 .. 2^30-1]. That is equivalent to having its 32-bit
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698