OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 } | 1397 } |
1398 | 1398 |
1399 ZoneList<Expression*>* args = node->arguments(); | 1399 ZoneList<Expression*>* args = node->arguments(); |
1400 Comment cmnt(masm_, "[ CallRuntime"); | 1400 Comment cmnt(masm_, "[ CallRuntime"); |
1401 Runtime::Function* function = node->function(); | 1401 Runtime::Function* function = node->function(); |
1402 | 1402 |
1403 if (function == NULL) { | 1403 if (function == NULL) { |
1404 // Prepare stack for calling JS runtime function. | 1404 // Prepare stack for calling JS runtime function. |
1405 frame_->Push(node->name()); | 1405 frame_->Push(node->name()); |
1406 // Push the builtins object found in the current global object. | 1406 // Push the builtins object found in the current global object. |
1407 __ movq(kScratchRegister, GlobalObject()); | 1407 Result temp = allocator()->Allocate(); |
1408 __ movq(kScratchRegister, | 1408 ASSERT(temp.is_valid()); |
1409 FieldOperand(kScratchRegister, GlobalObject::kBuiltinsOffset)); | 1409 __ movq(temp.reg(), GlobalObject()); |
1410 frame_->Push(kScratchRegister); | 1410 __ movq(temp.reg(), |
| 1411 FieldOperand(temp.reg(), GlobalObject::kBuiltinsOffset)); |
| 1412 frame_->Push(&temp); |
1411 } | 1413 } |
1412 | 1414 |
1413 // Push the arguments ("left-to-right"). | 1415 // Push the arguments ("left-to-right"). |
1414 int arg_count = args->length(); | 1416 int arg_count = args->length(); |
1415 for (int i = 0; i < arg_count; i++) { | 1417 for (int i = 0; i < arg_count; i++) { |
1416 Load(args->at(i)); | 1418 Load(args->at(i)); |
1417 } | 1419 } |
1418 | 1420 |
1419 if (function == NULL) { | 1421 if (function == NULL) { |
1420 // Call the JS runtime function. | 1422 // Call the JS runtime function. |
(...skipping 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3988 break; | 3990 break; |
3989 default: | 3991 default: |
3990 UNREACHABLE(); | 3992 UNREACHABLE(); |
3991 } | 3993 } |
3992 } | 3994 } |
3993 | 3995 |
3994 | 3996 |
3995 #undef __ | 3997 #undef __ |
3996 | 3998 |
3997 } } // namespace v8::internal | 3999 } } // namespace v8::internal |
OLD | NEW |