OLD | NEW |
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 Loading... |
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 __ movl(rax, FieldOperand(receiver, String::kLengthOffset)); | 330 __ movq(rax, FieldOperand(receiver, String::kLengthOffset)); |
331 __ Integer32ToSmi(rax, rax); | |
332 __ ret(0); | 331 __ ret(0); |
333 | 332 |
334 // Check if the object is a JSValue wrapper. | 333 // Check if the object is a JSValue wrapper. |
335 __ bind(&check_wrapper); | 334 __ bind(&check_wrapper); |
336 __ cmpl(scratch1, Immediate(JS_VALUE_TYPE)); | 335 __ cmpl(scratch1, Immediate(JS_VALUE_TYPE)); |
337 __ j(not_equal, miss); | 336 __ j(not_equal, miss); |
338 | 337 |
339 // Check if the wrapped value is a string and load the length | 338 // Check if the wrapped value is a string and load the length |
340 // directly if it is. | 339 // directly if it is. |
341 __ movq(scratch2, FieldOperand(receiver, JSValue::kValueOffset)); | 340 __ movq(scratch2, FieldOperand(receiver, JSValue::kValueOffset)); |
342 GenerateStringCheck(masm, scratch2, scratch1, miss, miss); | 341 GenerateStringCheck(masm, scratch2, scratch1, miss, miss); |
343 __ movl(rax, FieldOperand(scratch2, String::kLengthOffset)); | 342 __ movq(rax, FieldOperand(scratch2, String::kLengthOffset)); |
344 __ Integer32ToSmi(rax, rax); | |
345 __ ret(0); | 343 __ ret(0); |
346 } | 344 } |
347 | 345 |
348 | 346 |
349 static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm, | 347 static void CompileCallLoadPropertyWithInterceptor(MacroAssembler* masm, |
350 Register receiver, | 348 Register receiver, |
351 Register holder, | 349 Register holder, |
352 Register name, | 350 Register name, |
353 JSObject* holder_obj) { | 351 JSObject* holder_obj) { |
354 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 352 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
(...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 2372 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
2375 | 2373 |
2376 // Return the generated code. | 2374 // Return the generated code. |
2377 return GetCode(); | 2375 return GetCode(); |
2378 } | 2376 } |
2379 | 2377 |
2380 | 2378 |
2381 #undef __ | 2379 #undef __ |
2382 | 2380 |
2383 } } // namespace v8::internal | 2381 } } // namespace v8::internal |
OLD | NEW |