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

Side by Side Diff: src/runtime.cc

Issue 433853002: Implement lowering of JSLoadContext to machine operators. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Ben Titzer. Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.h ('k') | tools/generate-runtime-tests.py » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 9390 matching lines...) Expand 10 before | Expand all | Expand 10 after
9401 object = Handle<JSReceiver>(context->global_object()); 9401 object = Handle<JSReceiver>(context->global_object());
9402 } 9402 }
9403 9403
9404 RETURN_FAILURE_ON_EXCEPTION( 9404 RETURN_FAILURE_ON_EXCEPTION(
9405 isolate, Object::SetProperty(object, name, value, strict_mode)); 9405 isolate, Object::SetProperty(object, name, value, strict_mode));
9406 9406
9407 return *value; 9407 return *value;
9408 } 9408 }
9409 9409
9410 9410
9411 RUNTIME_FUNCTION(Runtime_LoadContextRelative) {
9412 SealHandleScope shs(isolate);
9413 ASSERT(args.length() == 3);
9414 CONVERT_ARG_CHECKED(Context, context, 0);
9415 CONVERT_SMI_ARG_CHECKED(depth, 1);
9416 CONVERT_SMI_ARG_CHECKED(index, 2);
9417 while (depth-- > 0) {
9418 context = context->previous();
9419 ASSERT(context->IsContext());
9420 }
9421 return context->get(index);
9422 }
9423
9424
9425 RUNTIME_FUNCTION(Runtime_StoreContextRelative) { 9411 RUNTIME_FUNCTION(Runtime_StoreContextRelative) {
9426 SealHandleScope shs(isolate); 9412 SealHandleScope shs(isolate);
9427 ASSERT(args.length() == 4); 9413 ASSERT(args.length() == 4);
9428 CONVERT_ARG_CHECKED(Context, context, 0); 9414 CONVERT_ARG_CHECKED(Context, context, 0);
9429 CONVERT_SMI_ARG_CHECKED(depth, 1); 9415 CONVERT_SMI_ARG_CHECKED(depth, 1);
9430 CONVERT_SMI_ARG_CHECKED(index, 2); 9416 CONVERT_SMI_ARG_CHECKED(index, 2);
9431 CONVERT_ARG_CHECKED(Object, value, 3); 9417 CONVERT_ARG_CHECKED(Object, value, 3);
9432 while (depth-- > 0) { 9418 while (depth-- > 0) {
9433 context = context->previous(); 9419 context = context->previous();
9434 ASSERT(context->IsContext()); 9420 ASSERT(context->IsContext());
(...skipping 6177 matching lines...) Expand 10 before | Expand all | Expand 10 after
15612 } 15598 }
15613 return NULL; 15599 return NULL;
15614 } 15600 }
15615 15601
15616 15602
15617 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15603 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15618 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15604 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15619 } 15605 }
15620 15606
15621 } } // namespace v8::internal 15607 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | tools/generate-runtime-tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698