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

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 1857001: Revert "Changing string length field type from int to SMI." (Closed)
Patch Set: Created 10 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 Register scratch1, 320 Register scratch1,
321 Register scratch2, 321 Register scratch2,
322 Label* miss) { 322 Label* miss) {
323 Label check_wrapper; 323 Label check_wrapper;
324 324
325 // Check if the object is a string leaving the instance type in the 325 // Check if the object is a string leaving the instance type in the
326 // scratch register. 326 // scratch register.
327 GenerateStringCheck(masm, receiver, scratch1, miss, &check_wrapper); 327 GenerateStringCheck(masm, receiver, scratch1, miss, &check_wrapper);
328 328
329 // Load length directly from the string. 329 // Load length directly from the string.
330 __ movq(rax, FieldOperand(receiver, String::kLengthOffset)); 330 __ movl(rax, FieldOperand(receiver, String::kLengthOffset));
331 __ Integer32ToSmi(rax, rax);
331 __ ret(0); 332 __ ret(0);
332 333
333 // Check if the object is a JSValue wrapper. 334 // Check if the object is a JSValue wrapper.
334 __ bind(&check_wrapper); 335 __ bind(&check_wrapper);
335 __ cmpl(scratch1, Immediate(JS_VALUE_TYPE)); 336 __ cmpl(scratch1, Immediate(JS_VALUE_TYPE));
336 __ j(not_equal, miss); 337 __ j(not_equal, miss);
337 338
338 // Check if the wrapped value is a string and load the length 339 // Check if the wrapped value is a string and load the length
339 // directly if it is. 340 // directly if it is.
340 __ movq(scratch2, FieldOperand(receiver, JSValue::kValueOffset)); 341 __ movq(scratch2, FieldOperand(receiver, JSValue::kValueOffset));
341 GenerateStringCheck(masm, scratch2, scratch1, miss, miss); 342 GenerateStringCheck(masm, scratch2, scratch1, miss, miss);
342 __ movq(rax, FieldOperand(scratch2, String::kLengthOffset)); 343 __ movl(rax, FieldOperand(scratch2, String::kLengthOffset));
344 __ Integer32ToSmi(rax, rax);
343 __ ret(0); 345 __ ret(0);
344 } 346 }
345 347
346 348
347 static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm, 349 static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm,
348 Register receiver, 350 Register receiver,
349 Register holder, 351 Register holder,
350 Register name, 352 Register name,
351 JSObject* holder_obj) { 353 JSObject* holder_obj) {
352 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 354 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); 2022 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
2021 2023
2022 // Return the generated code. 2024 // Return the generated code.
2023 return GetCode(); 2025 return GetCode();
2024 } 2026 }
2025 2027
2026 2028
2027 #undef __ 2029 #undef __
2028 2030
2029 } } // namespace v8::internal 2031 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698